You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import EventKit
enum EventKitAuthorization {
static func allowsRead ( status : EKAuthorizationStatus ) -> Bool {
switch status {
case . authorized , . fullAccess :
return true
case . writeOnly :
return false
case . notDetermined :
// D o n ’ t p r o m p t d u r i n g n o d e . i n v o k e ; p r o m p t s b l o c k t h e i n v o k e a n d l e a d t o t i m e o u t s .
return false
case . restricted , . denied :
return false
@ unknown default :
return false
}
}
static func allowsWrite ( status : EKAuthorizationStatus ) -> Bool {
switch status {
case . authorized , . fullAccess , . writeOnly :
return true
case . notDetermined :
// D o n ’ t p r o m p t d u r i n g n o d e . i n v o k e ; p r o m p t s b l o c k t h e i n v o k e a n d l e a d t o t i m e o u t s .
return false
case . restricted , . denied :
return false
@ unknown default :
return false
}
}
}