Skip to content

Instantly share code, notes, and snippets.

@alvareztech
Created February 7, 2014 16:47
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 alvareztech/8866627 to your computer and use it in GitHub Desktop.
Save alvareztech/8866627 to your computer and use it in GitHub Desktop.
iOS: Ask if location service is enabled and with permission.
if ([CLLocationManager locationServicesEnabled]) {
NSLog(@"Servicio de localización habilitado.");
if([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) {
NSLog(@"Servicio de localización habilitado sin permiso de uso.");
} else {
NSLog(@"Servicio de localización habilitado con permiso de uso.");
}
} else {
NSLog(@"Servicio de localización deshabilitado.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment