Last active
December 13, 2015 21:19
-
-
Save danielctull/4976777 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (void)checkToDisplayConnectionAlert { | |
| static BOOL hasAlerted = NO; | |
| BOOL canConnect = ([[DLMHTTPClient sharedClient] networkReachabilityStatus] == AFNetworkReachabilityStatusReachableViaWWAN | [[DLMHTTPClient sharedClient] networkReachabilityStatus] == AFNetworkReachabilityStatusReachableViaWiFi); | |
| if (canConnect) { | |
| hasAlerted = NO; | |
| } else if (!hasAlerted) { | |
| hasAlerted = YES; | |
| NSString *message = NSLocalizedString(@"comments.noconnection", nil); | |
| [[[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment