Search code examples
iosobjective-ccllocationmanageribeacon

Is there any good way to know when CLLocationManager's startMonitoringForRegion has completed?


From CLLocationManager.h:

/*
 *  startMonitoringForRegion:
 *
 *  Discussion:
 *      Start monitoring the specified region.
 *
 *      If a region of the same type with the same identifier is already being monitored for this application,
 *      it will be removed from monitoring. For circular regions, the region monitoring service will prioritize
 *      regions by their size, favoring smaller regions over larger regions.
 *
 *      This is done asynchronously and may not be immediately reflected in monitoredRegions.
 */
- (void)startMonitoringForRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_TBD,__IPHONE_5_0);

Is there a good way to know when this asynchronous call has completed? I'm trying to perform another action once I know region monitoring is started for a certain region, but it looks like that can take anywhere from >1s to >20s.


Solution

  • of course yes. in the CLLocationManagerDelegate you will find - locationManager:didStartMonitoringForRegion: . here you will find the full delegate description.