4
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)")
}
我不知道這是否是相關的,但我使用SWReavealViewController。 Xcode9,編譯爲iOS 8.0,這兩個模擬器和真實設備
該代碼在哪裏執行? – RaffAl
我在不同的地方嘗試過 – gutte