From bbf98469f82a9624aeaed9d0a7a1fb991a01bba8 Mon Sep 17 00:00:00 2001 From: Vinh Nguyen Date: Fri, 27 Oct 2023 07:04:19 +0700 Subject: [PATCH] Fix iOS 17 Calendar permission request --- Sources/Shift/Shift.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Shift/Shift.swift b/Sources/Shift/Shift.swift index 9762867..6c20d80 100644 --- a/Sources/Shift/Shift.swift +++ b/Sources/Shift/Shift.swift @@ -223,7 +223,11 @@ public final class Shift: ObservableObject { } private func requestCalendarAccess() async throws -> Bool { - try await eventStore.requestAccess(to: .event) + if #available(iOS 17, *) { + try await eventStore.requestFullAccessToEvents() + } else { + try await eventStore.requestAccess(to: .event) + } } }