I have successfully saved the events of my application to local calendar using Eventkit but now I want to delete the events that I have saved using my application only.
But the below code give me list of all events saved on calendar but I just want to delete my own saved event. How can I do that?
let predicate = eventStore.predicateForEvents(withStart: start, end: endDate, calendars: [calendar])
let events = eventStore.events(matching: predicate)
When saving events to calendar you can store
EKEvent's eventIdentifier property.And when you want to delete events that were created by you, you can query them by identifiers.
Note: store
eventIdentfieronly after callingeventStore.save(...)method.