Contents

pausesLocationUpdatesAutomatically

A Boolean value that indicates whether the location-manager object may pause location updates.

Declaration

var pausesLocationUpdatesAutomatically: Bool { get set }

Mentioned in

Discussion

Allowing the location manager to pause updates can improve battery life on the target device without sacrificing location data. Setting this property to true causes the location manager to pause updates (and powers down the appropriate hardware) at times when the location data is unlikely to change. For example, if the user stops for food while using a navigation app, the location manager might pause updates for a period of time. You can help the determination of when to pause location updates by assigning a value to the activityType property.

After a pause occurs, it’s your responsibility to restart location services again when you determine that they’re needed. Core Location calls the locationManagerDidPauseLocationUpdates(_:) method of your location manager’s delegate to let you know that a pause has occurred. In that method configure a local notification that has a UNLocationNotificationTrigger to notify when the user exits the current region. The message for the local notification should prompt the user to launch your app again so that it can resume updates.

On supported platforms the default value of this property is true; otherwise the default value is false and is immutable.

See Also

Running the standard location service