我需要許可使用的是iOS的提醒,併爲我這樣做:功能執行IOS
switch EKEventStore.authorizationStatus(for: .reminder) {
case .authorized:
print("Access granted")
//everything's normal here
//executing my function here
case .denied:
print("Access denied")
case .notDetermined:
print("not defined yet")
//No determined so asking for permission
self.eventStore.requestAccess(to: .reminder) { (granted, error) -> Void in
if granted == true {
print("permission granted")
//executing my function here after getting permissions but this piece of code executes after a long delay
//this piece of codes are executing after a while say 5-10 seconds
}else if error != nil{
print("ther's an error : \(error)")
}
}
default:
print("Case Default")
}
時,應用程式會提示用戶進行提醒和用戶的權限以上解釋授予我的下一個功能功能執行,但過了一段時間(5-10秒)
任何人都可以解釋爲什麼會發生?
嘿人感謝您的迴應,感謝您的努力。 –