Created
September 3, 2012 21:14
-
-
Save kevinmcmahon/3613612 to your computer and use it in GitHub Desktop.
Initialization of Location Services
This file contains 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)initializeLocationServices { | |
// Check to ensure location services are enabled | |
if(![CLLocationManager locationServicesEnabled]) { | |
[self showAlertWithMessage:@"You need to enable location services to use this app."]; | |
return; | |
} | |
if(![CLLocationManager regionMonitoringAvailable]) { | |
[self showAlertWithMessage:@"This app requires region monitoring features which are unavailable on this device."]; | |
return; | |
} | |
_locationManager = [[CLLocationManager alloc] init]; | |
_locationManager.delegate = self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment