locationServicesEnabled
A Boolean value indicating whether location services are enabled on the device.
Declaration
var locationServicesEnabled: Bool { get }Discussion
In iOS, the user can enable or disable location services using the controls in Settings > Location Services. In macOS, the user can enable or disable location services from the Security & Privacy system preference.
If this property contains the value false and you start location updates anyway, the Core Location framework prompts the user with a confirmation alert asking whether location services should be reenabled.
Special Considerations
In iOS, this property is declared as nonatomic. In macOS, it is declared as atomic.