Instance Property

desiredAccuracy

The accuracy of the location data.

Declaration

@property(assign, nonatomic) CLLocationAccuracy desiredAccuracy;

Discussion

The receiver does its best to achieve the requested accuracy; however, the actual accuracy is not guaranteed.

You should assign a value to this property that is appropriate for your usage scenario. For example, if you need the current location only within a kilometer, you should specify kCLLocationAccuracyKilometer and not kCLLocationAccuracyBestForNavigation. Determining a location with greater accuracy requires more time and more power.

When requesting high-accuracy location data, the initial event delivered by the location service may not have the accuracy you requested. The location service delivers the initial event as quickly as possible. It then continues to determine the location with the accuracy you requested and delivers additional events, as necessary, when that data is available.

For iOS and macOS, the default value of this property is kCLLocationAccuracyBest. For watchOS, the default value is kCLLocationAccuracyHundredMeters.

This property is used only in conjunction with the standard location services and is not used when monitoring significant location changes.

Special Considerations

In iOS, this property is declared as nonatomic. In macOS, it is declared as atomic.

See Also

Initiating Standard Location Updates

- startUpdatingLocation

Starts the generation of updates that report the user’s current location.

- stopUpdatingLocation

Stops the generation of location updates.

- requestLocation

Requests the one-time delivery of the user’s current location.

pausesLocationUpdatesAutomatically

A Boolean value indicating whether the location manager object may pause location updates.

allowsBackgroundLocationUpdates

A Boolean value indicating whether the app should receive location updates when suspended.

showsBackgroundLocationIndicator

A Boolean indicating whether the status bar changes its appearance when an app uses location services in the background.

distanceFilter

The minimum distance (measured in meters) a device must move horizontally before an update event is generated.

CLLocationDistanceMax

A constant indicating the maximum distance.

kCLDistanceFilterNone

A constant indicating that all movement should be reported.

activityType

The type of user activity associated with the location updates.

CLActivityType

Constants indicating the type of activity associated with location updates.