0

Is it possible to check if a given latitude and longitude falls inside of a given GeoFence using iOS 5 APIs? How?

Moshe
  • 57,511
  • 78
  • 272
  • 425

1 Answers1

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