Skip to content

Instantly share code, notes, and snippets.

@greggjaskiewicz
Created February 13, 2020 13:22
Show Gist options
  • Save greggjaskiewicz/304c94fab432cf01203faab01189ffca to your computer and use it in GitHub Desktop.
Save greggjaskiewicz/304c94fab432cf01203faab01189ffca to your computer and use it in GitHub Desktop.
reachability changed notification network status convenience unwrapped
+ (GCNetworkReachabilityStatus)statusFromNotification:(NSNotification *)notification {
NSNumber *statusNumber = notification.userInfo[kGCNetworkReachabilityStatusKey];
if (statusNumber == nil) {
return GCNetworkReachabilityStatusNotReachable;
}
GCNetworkReachabilityStatus status = [statusNumber intValue];
return status;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment