Skip to content

Instantly share code, notes, and snippets.

@StuartFarmer
Last active August 29, 2015 14:20
Show Gist options
  • Save StuartFarmer/39d62001173bf2e0f868 to your computer and use it in GitHub Desktop.
Save StuartFarmer/39d62001173bf2e0f868 to your computer and use it in GitHub Desktop.
Set up location manager
// Initialize location services.
locationManager = [[CLLocationManager alloc] init];
[locationManager requestAlwaysAuthorization];
locationManager.delegate = self;
// Accuracy constants here. These should be tested for battery optimization.
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
locationManager.distanceFilter = kCLDistanceFilterNone;
[locationManager startUpdatingLocation];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment