iOS wrapper around AFNetworking makes it easy to use.
- Download repository, then add LGConnection directory to your project.
- Also you need to install libraries:
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the "Get Started" section for more details.
platform :ios, '6.0'
pod 'LGConnection', '~> 1.0.0'
In the source files where you need to use the library, import the header file:
#import "LGConnection.h"You have several methods for initialization:
- (instancetype)initWithRepeatAfterConnectionLost:(BOOL)repeat;
- (instancetype)initWithRepeatAfterConnectionLost:(BOOL)repeat
connectionLostHandler:(void(^)())connectionLostHandler
connectionRestoreHandler:(void(^)())connectionRestoreHandler;LGConnection use Reachability to watch for internet connection. "RepeatAfterConnectionLost" means that if connection is lost, then all requests will try to reconnect while connection is restoring.
For more details see LGConnection.h
LGConnection is released under the MIT license. See LICENSE for details.