documentation seems to say that kCLAuthorizationStatusAuthorizedAlways应该是CLLocationManager.authorizationStatus()
可接受的返回值,尽管这样:
.AuthorizedWhenInUse
,.Denied
和.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
确实可以工作,并且指向与.AuthorizedAlways
应该相同的整数值(根据Objective-C文档),但已弃用了它。关于正确而不是不建议执行的任何建议?
最佳答案
.AuthorizedAlways
已取代iOS 8.2中的.Authorized
。如果您使用的是8.2 SDK或更高版本,请使用.AuthorizedAlways
。参见iOS 8.2 API Diffs
关于ios - 未定义Swift CLAuthorizationStatus.AlwaysAuthorized,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27657804/