Skip to content

Commit

Permalink
Fix iOS 17 Calendar permission request. Add new error handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinhnx committed Oct 27, 2023
1 parent 04f08f3 commit e585b1c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Clendar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2051,8 +2051,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/vinhnx/Shift.git";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 0.9.0;
kind = upToNextMajorVersion;
minimumVersion = 0.10.0;
};
};
A3D3EAD025CE3F8000EC3D1D /* XCRemoteSwiftPackageReference "SwiftyStoreKit" */ = {
Expand Down
4 changes: 2 additions & 2 deletions Clendar.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"repositoryURL": "https://github.com/vinhnx/Shift.git",
"state": {
"branch": null,
"revision": "8d0cdd977475ece76d7aa896bdd7b7990b4fb87c",
"version": "0.9.0"
"revision": "bbf98469f82a9624aeaed9d0a7a1fb991a01bba8",
"version": "0.10.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Clendar/Base/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct ContentView: View {
else {
NewEventView(
eventStore: eventKitWrapper.eventStore,
event: EKEvent.init(eventStore: eventKitWrapper.eventStore)
event: EKEvent(eventStore: eventKitWrapper.eventStore)
.then {
$0.startDate = store.selectedDate
$0.endDate = store.selectedDate
Expand Down
6 changes: 5 additions & 1 deletion Clendar/Base/ContentViewModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ struct ContentViewModifier: ViewModifier {

private func fetchEvents(for date: Date = Date()) {
Task {
try await eventKitWrapper.fetchEvents(for: date, filterCalendarIDs: UserDefaults.savedCalendarIDs, calendar: CalendarIdentifier.current.calendar)
do {
try await eventKitWrapper.fetchEvents(for: date, filterCalendarIDs: UserDefaults.savedCalendarIDs, calendar: CalendarIdentifier.current.calendar)
} catch {
AlertManager.showAlert(message: "Unable to fetch Calendar events. Please try again or contact developer. Thank you!", actionTitle: "Cancel")
}
}
}

Expand Down

0 comments on commit e585b1c

Please sign in to comment.