Swift CLAuthorizationStatus.AlwaysAuthorized not defined

The documentation says that kCLAuthorizationStatusAuthorizedAlways should be an acceptable return from CLLocationManager.authorizationStatus() , although this is:

  • Does not work.
  • Not consistent with the name of other possible values, such as .AuthorizedWhenInUse , .Denied and .Determined .

     CLLocationManager.authorizationStatus() == .AuthorizedAlways //'CLAuthorizationStatus.Type' does not have a member named 'AuthorizedAlways' CLLocationManager.authorizationStatus() == .kCLAuthorizationStatusAuthorizedAlways //'CLAuthorizationStatus.Type' does not have a member named 'kCLAuthorizationStatusAuthorizedAlways' 

.Authorized works and points to the same integer value as .AuthorizedAlways (as per Objective-C documentation), but it is deprecated.

Any suggestion for a proper, not deprecated implementation?

+6
source share
1 answer

.AuthorizedAlways replaced .Authorized in iOS 8.2. If you are using SDK 8.2 or later, use .AuthorizedAlways . See iOS 8.2 API Diffs

+3
source

Source: https://habr.com/ru/post/980167/


All Articles