Contents

desiredAccuracy

The accuracy of the location data that your app wants to receive.

Declaration

var desiredAccuracy: CLLocationAccuracy { get set }

Mentioned in

Discussion

The location service does its best to achieve the requested accuracy; however, apps must be prepared to use less accurate data. If your app isn’t authorized to access precise location information (isAuthorizedForPreciseLocation is false), changes to this property’s value have no effect; the accuracy is always kCLLocationAccuracyReduced.

To reduce your app’s impact on battery life, assign a value to this property that’s appropriate for your usage. For example, if you need the current location only within a kilometer, specify kCLLocationAccuracyKilometer. More accurate location data also takes more time to become available.

After you request high-accuracy location data, your app might still get data with a lower accuracy for a period of time. During the time it takes to determine the location within the requested accuracy, the location service keeps providing the data that’s available, even though that data isn’t as accurate as your app requested. Your app receives more accurate location data as that data becomes available.

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

This property effects only the standard location services, not for monitoring significant location changes.

Special Considerations

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

See Also

Specifying distance and accuracy