Skip to content

Commit

Permalink
Fix compile issue in Xcode 14 (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-b-m committed Nov 22, 2023
1 parent 7adcb50 commit 1b3cb19
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions FreeAPS/Sources/Services/Calendar/CalendarManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ final class BaseCalendarManager: CalendarManager, Injectable {
promise(.success(false))
case .authorized:
promise(.success(true))

#if swift(>=5.9)
case .fullAccess:
promise(.success(true))
case .writeOnly:
if #available(iOS 17.0, *) {
EKEventStore().requestFullAccessToEvents(completion: { (granted: Bool, error: Error?) -> Void in
if let error = error {
print("Calendar access not upgraded")
warning(.service, "Calendar access not upgraded", error: error)
}
promise(.success(granted))
})
}
#endif

@unknown default:
warning(.service, "Unknown calendar access status")
promise(.success(false))
Expand Down

0 comments on commit 1b3cb19

Please sign in to comment.