AuthorizationStatus для CLLocationManager устарел в iOS 14.IOS

Программируем под IOS
Anonymous
AuthorizationStatus для CLLocationManager устарел в iOS 14.

Сообщение Anonymous »

Я использую этот код, чтобы проверить, есть ли у меня доступ к местоположению пользователя или нет

Код: Выделить всё

if CLLocationManager.locationServicesEnabled() {
switch CLLocationManager.authorizationStatus() {
case .restricted, .denied:
hasPermission = false
default:
hasPermission = true
}
} else {
print("Location services are not enabled")
}
}
И Xcode(12) кричит на меня с таким предупреждением:

Код: Выделить всё

'authorizationStatus()' was deprecated in iOS 14.0
Итак, какая замена?

Подробнее здесь: https://stackoverflow.com/questions/640 ... -on-ios-14

Вернуться в «IOS»