Tutorial by Examples

Apple's Reachability class periodically checks the network status and alerts observers to changes. Reachability *internetReachability = [Reachability reachabilityForInternetConnection]; [internetReachability startNotifier];
Reachability uses NSNotification messages to alert observers when the network state has changed. Your class will need to become an observer. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil]; Elsewher...
- (void)reachabilityChanged:(NSNotification *)note { Reachability* reachability = [note object]; NetworkStatus netStatus = [reachability currentReachabilityStatus]; if (netStatus == NotReachable) { NSLog(@"Network unavailable"); } }
- (void)reachabilityChanged:(NSNotification *)note { Reachability* reachability = [note object]; NetworkStatus netStatus = [reachability currentReachabilityStatus]; switch (netStatus) { case NotReachable: NSLog(@"Network unavailable"); br...
Swift import SystemConfiguration /// Class helps to code reuse in handling internet network connections. class NetworkHelper { /** Verify if the device is connected to internet network. - returns: true if is connected to any internet network, false if is not co...

Page 1 of 1