Skip to content

Commit

Permalink
Ensure app can be built on xcode 14, since xcode 15 is in beta
Browse files Browse the repository at this point in the history
  • Loading branch information
DAcodedBEAT committed Sep 6, 2023
1 parent 816f993 commit 5a1cbee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions App/Modules/AppleExport/AppleCalendarExport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private class AppleCalendarExportService {
lazy var eventStore: EKEventStore = .init()

func requestAccess(completionHandler: @escaping CalendarExportHandler) {
#if swift(>=5.9)
if #available(iOS 17.0, *) {
eventStore.requestFullAccessToEvents { granted, error in
if granted, error == nil {
Expand All @@ -97,14 +98,17 @@ private class AppleCalendarExportService {
}
}
} else {
#endif
eventStore.requestAccess(to: EKEntityType.event, completion: { granted, error in
if granted, error == nil {
completionHandler(true)
} else {
completionHandler(false)
}
})
#if swift(>=5.9)
}
#endif
}

func clearGlucoseEvents() {
Expand Down

0 comments on commit 5a1cbee

Please sign in to comment.