Last active
August 29, 2015 13:57
-
-
Save ryanmasondavies/9630433 to your computer and use it in GitHub Desktop.
Using CLLocationManager and CLRegion to detect proximity to the Eiffel Tower
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLLocationManager *locationManager = [[CLLocationManager alloc] init]; | |
[locationManager setDelegate:self]; | |
[locationManager setDesiredAccuracy:kCLLocationAccuracyHundredMeters]; | |
[self setLocationManager:locationManager]; | |
// ... | |
CLLocationCoordinate2D eiffelTowerCoordinates = CLLocationCoordinate2DMake(48.858093, 2.294694); | |
CLLocationDistance radius = 20; // 20 meters | |
CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter:eiffelTowerCoordinates radius:20.0 identifier:@"Eiffel Tower"]; | |
[[self locationManager] startMonitoringForRegion:region]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment