Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 14, 2016 21:26
Show Gist options
  • Save nfarah86/8815467660d72548ab0f00d914e6d432 to your computer and use it in GitHub Desktop.
Save nfarah86/8815467660d72548ab0f00d914e6d432 to your computer and use it in GitHub Desktop.
Inform the Delegate with authorization status change
// omitted code
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
{
switch (status)
{
case kCLAuthorizationStatusNotDetermined:
NSLog(@"Location services authorization status not yet determined.");
break;
case kCLAuthorizationStatusDenied:
NSLog(@"Location services authorization was denied.");
break;
case kCLAuthorizationStatusRestricted:
NSLog(@"Location services authorization is restricted.");
break;
case kCLAuthorizationStatusAuthorizedAlways:
case kCLAuthorizationStatusAuthorizedWhenInUse:
NSLog(@"Location services authorization granted. Requesting location updates...");
[self.locationManager startUpdatingLocation];
self.updating = YES;
break;
default:
break;
}
}
// omitted code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment