Skip to content

Instantly share code, notes, and snippets.

@zerho
Created September 15, 2013 23:12
Show Gist options
  • Save zerho/6575108 to your computer and use it in GitHub Desktop.
Save zerho/6575108 to your computer and use it in GitHub Desktop.
- (BOOL) networkAvailable
{
[self pingReachabilityInternal];
BOOL isReachable = ((connectionFlags & kSCNetworkFlagsReachable) != 0);
BOOL needsConnection = ((connectionFlags & kSCNetworkFlagsConnectionRequired) != 0);
return (isReachable && !needsConnection) ? YES : NO;
}
// kSCNetworkFlagsReachable
// kSCNetworkFlagsConnectionRequired
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment