Skip to content

Instantly share code, notes, and snippets.

@kevinmcmahon
Created September 3, 2012 21: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 kevinmcmahon/3613612 to your computer and use it in GitHub Desktop.
Save kevinmcmahon/3613612 to your computer and use it in GitHub Desktop.
Initialization of Location Services
- (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