Contents

activityType

The type of activity the app expects the user to typically perform while in the app’s location session.

Declaration

var activityType: CLActivityType { get set }

Mentioned in

Discussion

An app should use activityType to communicate to Core Location algorithms the type of activity the app’s users typically perform while using the app. The location manager uses the information in this property as a cue to determine when the system may pause location updates. Pausing updates gives the system the opportunity to save power in situations where the user’s location isn’t likely to be changing. For example, if the activity type is CLActivityType.automotiveNavigation and no location changes have occurred recently, the system might power down radios until the system detects movement again.

After a pause occurs, it’s your responsibility to restart location services again when you determine that they’re needed. For more information on ways to restart location services after a pause, see the discussion of the pausesLocationUpdatesAutomatically property.

The default value of this property is CLActivityType.other.

If your app allows the user to change the type activity they’re performing, for example in a navigation app that allows the user to switch between driving or walking modes, you should also update the activityType as well.

See Also

Running the standard location service