问题
My app uses geofencing as well as iBeacon
monitoring. I have set up some CLCircularRegion
as well as CLBeaconRegion
to be monitor. So whenever, i hit a new beacon or new location, then
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
NSLog(@"CLCircularRegion or CLBeaconRegion?, I am confused!!!");
}
will be invoked. Can anybody tell me how to find out which region(i.e.,CLCircularRegion/CLBeaconRegion) is calling the delegate.
回答1:
Finally found my own answer.
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
if (region.class == CLCircularRegion.class) {
NSLog(@"CLCircularRegion")
} else {
NSLog("CLBeaconRegion")
}
}
来源:https://stackoverflow.com/questions/33500467/how-to-differentiate-between-clcircularregion-and-clbeaconregion-invoking-dident