0 votes
594 views
asked in xCode by (4k points)
Hi

  How to check the internet connection in objective-c (xCode)

1 Answer

0 votes
answered by (4.2k points)

Hi 

import "Reachability.h"
#import <SystemConfiguration/SystemConfiguration.h>
//Class.m
- (BOOL)connected 
{
    Reachability *reachability = [Reachability reachabilityForInternetConnection];  
    NetworkStatus networkStatus = [reachability currentReachabilityStatus]; 
    return networkStatus != NotReachable;
}

Categories

...