Checking for Services

To directly determine whether location services are enabled for the device, there is a class method available on the CLLocationManager called locationServicesEnabled.

if ([CLLocationManager locationServicesEnabled]){    ICFLocationManager *appLocationManager =    [ICFLocationManager sharedLocationManager];    [appLocationManager.locationManager startUpdatingLocation];}else{    NSLog(@"Location Services disabled.");}

This can be used to customize how the app deals with having or not having the current location available. An app that deals with locations should gracefully handle when the user does not grant access to the current location, and give the user clear instructions for enabling access ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.