Download apps/ios/Sources/EventKit/EventKitAuthorization.swift from Darochin/openskynet: direct link, hf CLI and curl.
- Browser
- Download file 979 Bytes
-
https://huggingface.co/Darochin/openskynet/resolve/main/apps/ios/Sources/EventKit/EventKitAuthorization.swift
- Command line
-
hf download hf://Darochin/openskynet/apps/ios/Sources/EventKit/EventKitAuthorization.swift
-
curl -L -o EventKitAuthorization.swift https://huggingface.co/Darochin/openskynet/resolve/main/apps/ios/Sources/EventKit/EventKitAuthorization.swift
979 Bytes
| import EventKit | |
| enum EventKitAuthorization { | |
| static func allowsRead(status: EKAuthorizationStatus) -> Bool { | |
| switch status { | |
| case .authorized, .fullAccess: | |
| return true | |
| case .writeOnly: | |
| return false | |
| case .notDetermined: | |
| // Don’t prompt during node.invoke; prompts block the invoke and lead to timeouts. | |
| 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: | |
| // Don’t prompt during node.invoke; prompts block the invoke and lead to timeouts. | |
| return false | |
| case .restricted, .denied: | |
| return false | |
| @unknown default: | |
| return false | |
| } | |
| } | |
| } | |