Returns a Boolean value indicating whether location services are enabled on the device.
- iOS 4.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Location
YES if location services are enabled on the device;
NO if they are not.
Users can enable or disable location services by toggling the Location Services switch in Settings > Privacy.
When users enable the switch, the system returns your app's authorization to its previous state and calls your delegate's
Manager: did Change Authorization Status:
You are not required to call
location. However, If you wish to display instructions about enabling location services, you may check the return value of this method to find out if the services are disabled for the entire device, or just for your app. If the result is
true, provide instructions for enabling services for your app; otherwise, provide instructions for enabling the Location Services switch in Settings > Privacy.
If users disable or deny location services and you attempt to start location updates anyway, the location manager reports an error to its delegate. See
location for more information.