An app-provided string that describes the reason for using location services.
Deprecated
Set the purpose string using the NSLocation
and NSLocation
key in the app’s Info
instead.
SDKs
- iOS 3.2–6.0Deprecated
- macOS 10.7+
- Mac Catalyst 13.0–13.0Deprecated
Framework
- Core Location
Declaration
var purpose: String? { get set }
Discussion
If this property is not nil
and the system needs to ask for the user’s consent to use location services, it displays the provided string. You can use this string to explain why your app is using location services.
You must set the value of this property prior to starting any location services. Because the string is ultimately displayed to the user, you should always load it from a localized strings file.