When I try to call [newEventStore defaultCalendarForNewEvents], it returns an error message says:
[707:907] defaultCalendarForNewEvents failed: Error Domain
I had the same problem, but finally find what was the reason.
My case was to add my Reminder and Calendar events, but I was using one EKEventStore
. In the end I seperate them and problem dissapeared:
private static let calendarEventStore = EKEventStore()
private static let remindersEventStore = EKEventStore()
So now I'm using calendarEventStore
for all things related to calendar event and remindersEventStore
for reminder one.
——
In my opinion it was related to the fact that I requested defaultCalendarForNewEvents
and defaultCalendarForNewReminders()
in one EKEventStore
entity.
Also this one from EKEventStore
docs:
Events, Reminders, and Calendar objects retrieved from an event store cannot be used with any other event store