This is the singleton classes created on support of Reachability - v3.2. It is ARC-compatible, and it uses the new GCD methods to notify of network changes. This class also notifies when the network becomes reachable and unreachable and shows the message on interface.
ReachabilityHandler , Reachability and KSToastView
which is already in the project.
just drag ReachabilityHandler , Reachability and KSToastView
Once you have added the .h/m files to your project, simply:
- Go to the Project->TARGETS->Build Phases->Link Binary With Libraries.
- Press the plus in the lower left of the list.
- Add SystemConfiguration.framework.
- In your
didFinishLaunchingWithOptions
write[ReachabilityHandler sharedHandler];
to start notifier.
- (void)viewDidLoad {
[super viewDidLoad];
if (![ReachabilityHandler checkInternetConnection]) {
NSLog(@"Internet is available");
}else{
NSLog(@"Internet is unavailable");
}
// Do any additional setup after loading the view, typically from a nib.
}
- iOS Developer sudhakar varma