I use EventKit in iOS to interact with Calendar.app. In one case, I need to delete a calendar from my app. So I use EventStore.removeCalendar(_:Commit:) function with the commit set to true. The calendar I am trying to delete is an iCloud calendar.

However, I found that after the calendar was deleted, it reappeared back itself. I am positive that it is not my mistake to add the calendar back as I have only one function regarding to creating calendars in my app and it is not called in between the deletion and reappearing.

I suspect it is iCloud who automatically adds it back. I tried to enter fly mode before deletion and the deleted calendar never reappears itself.

Has anyone experienced similar issue? If so, how can I tell iCloud that I want to delete the calendar so don't add it back.

Thanks.

1

1 Answer

You can't tell iCloud not to add the calendar back. My guess is that when iCloud syncs stuff from a different device (that also includes updates in the given calendar), it'll treat those as higher priority, thus adding the calendar back.

This is something that occasionally happened to me while deleting the calendar through the 'Calendar' app, so the short answer is that you can't force a calendar to stay deleted.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy