是否可以使用iOS 5 API检查给定的纬度和经度是否属于给定的GeoFence?怎么样?
答案 0 :(得分:5)
简单的答案是肯定的:
CLRegion *region = your geofence;
CLLocationCoordinate2D myLocation = CLLocationCoordinate2DMake(38.9, -77.04);
if ([region containsCoordinate:myLocation]) {
NSLog(@"You're soaking in it.");
}
请注意,目前仅支持圆形区域(“栅栏”)。请参阅Location Awareness Programming Guide和CLRegion Class Reference。