Vashum
Vashum

Reputation: 853

How to differentiate between CLCircularRegion and CLBeaconRegion invoking didEnterRegion

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.

Upvotes: 0

Views: 321

Answers (1)

Vashum
Vashum

Reputation: 853

Finally found my own answer.

- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
if (region.class == CLCircularRegion.class) {
        NSLog(@"CLCircularRegion")
    } else {
        NSLog("CLBeaconRegion")
  }

}

Upvotes: 1

Related Questions