I'm using EventKit to create and remove calendar (EKEvent) events.
My code is very basic, create an EKEventStore() and add a new event (EKEvent) using save. Later in some specific scenario the event is fetched from the eventStore using event(withIdentifier:) and removed.
Everything works well until the app is restarted.
When trying to fetch an event that was saved in previous run of the app the fetch returns nil with exception:
2018-01-26 20:26:30.532019+0200 MyApplication[1029:329807] [EventKit] Error getting event with identifier 174799E7-BD04-48B6-8B54-60AC28F4224C:FF38551F-EA72-4718-8DAD-827E48078E63: Error Domain=EKCADErrorDomain Code=1010 "(null)"
Save event line:
eventStore.save(event, span: .futureEvents, commit: true)
Fetch event line:
let event = eventStore.event(withIdentifier: eventIdentifer)
Any ideas?