Observe network state in Object-C for iOS.
- (void)viewDidLoad
{
[super viewDidLoad];
_label.text = MOINetworkStateText([MOINetworkState currentState]);
_state = [[MOINetworkState alloc] initWithDidChangeHandler:^(MOINetworkStateCode code) {
_label.text = MOINetworkStateText(code);
}];
}
// in your pod file
pod 'MOINetworkState', :git => 'https://github.com/mconintet/MOINetworkState.git'
// command line
pod install