Is it possible to check if a given latitude and longitude falls inside of a given GeoFence using iOS 5 APIs? How?
Asked
Active
Viewed 2,818 times
1 Answers
5
The simple answer is yes:
CLRegion *region = your geofence;
CLLocationCoordinate2D myLocation = CLLocationCoordinate2DMake(38.9, -77.04);
if ([region containsCoordinate:myLocation]) {
NSLog(@"You're soaking in it.");
}
Note that only circular regions ("fences") are currently supported. See the Location Awareness Programming Guide and the CLRegion Class Reference.

rob mayoff
- 375,296
- 67
- 796
- 848
-
I guess containsCoordinate is deprecated and most of the syntax has been changed. – Rizwan Ahmed Sep 25 '15 at 14:59