【发布时间】:2021-01-12 08:40:44
【问题描述】:
我使用此代码检查我是否可以访问用户位置
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
那么替换是什么?
【问题讨论】:
标签: ios swift core-location ios14