Instance Method

locationManager(_:didExitRegion:)

Tells the delegate that the user left the specified region.

Declaration

optional func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion)

Parameters

manager

The location manager object reporting the event.

region

An object containing information about the region that was exited.

Discussion

Because regions are a shared application resource, every active location manager object delivers this message to its associated delegate. It does not matter which location manager actually registered the specified region. And if multiple location managers share a delegate object, that delegate receives the message multiple times.

The region object provided may not be the same one that was registered. As a result, you should never perform pointer-level comparisons to determine equality. Instead, use the region’s identifier string to determine if your delegate should respond.

See Also

Responding to Region Events

func locationManager(CLLocationManager, didEnterRegion: CLRegion)

Tells the delegate that the user entered the specified region.

func locationManager(CLLocationManager, didDetermineState: CLRegionState, for: CLRegion)

Tells the delegate about the state of the specified region.

func locationManager(CLLocationManager, didStartMonitoringFor: CLRegion)

Tells the delegate that a new region is being monitored.