【发布时间】:2017-10-19 17:31:19
【问题描述】:
iOS对话框提示,半秒后消失:
let locationManager = CLLocationManager()
switch CLLocationManager.authorizationStatus() {
case .authorizedWhenInUse:
print("In Use \(locationManager.location?.description)")
case .denied, .restricted:
print("denied")
case .notDetermined:
locationManager.requestWhenInUseAuthorization()
case .authorizedAlways:
print("always \(locationManager.location)")
}
我不知道这是否相关,但我正在使用 SWRavealViewController。 Xcode9,为iOS 8.0编译,模拟器和真机都有
【问题讨论】:
-
这段代码在哪里执行?
-
我在不同的地方试过
标签: ios swift cllocationmanager