Skip to content

Instantly share code, notes, and snippets.

@rondy
Created July 17, 2012 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rondy/3130990 to your computer and use it in GitHub Desktop.
Save rondy/3130990 to your computer and use it in GitHub Desktop.
Verify network connection
- (BOOL) isConnectedToNetwork
{
Reachability *hostReachable = [Reachability reachabilityWithHostName:@"www.google.com"];
NetworkStatus internetStatus = [hostReachable currentReachabilityStatus];
return ((internetStatus == ReachableViaWiFi) || (internetStatus == ReachableViaWWAN));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment