I am writing an application that deals with calendars. In the application, I show a list of all available calendars to enable or disable the user. I do not use the EventKitUI for the purposes of my own design and user interface.
I get a neat list of calendars by polling the calendars property of an EKEventStore . However, on my device there is an EKCalendar object in this list that is not displayed by EKEventKitUI . This is the description of the object in the debugger:
EKCalendar <0xcea6b60> {title = Agenda; type = Local; allowsModify = YES; color =
I launch my iPhone in Dutch, so the name is "Agenda" and not "Calendar", but if you launch the iPhone in English, you will see. This appears to be the default calendar for iOS, but since I have all my calendars configured to sync with iCloud, it is disabled for the built-in calendar applications. I also want to disable it in my application, but I do not know how to do it.
From looking at the properties of EKCalendar I canβt distinguish one to decide which calendar I need to βhideβ. There's a type property that is "local" to this standard calendar, but if someone is not using iCloud, I think that all calendars are of local type. subscription is not it either, equal allowsContentModifications . I saw examples of people hiding the default calendar based on its name , but as you can see, the name is localized and therefore very impractical, this is simply wrong.
Which trick to decide which calendar is the default calendar and hide it or not to match the list of calendars displayed by your regular iCal / Calendar application?
EDIT:. Although the question has been marked as an answer, the answer contains a big "no, you cannot." I solved this problem for my users by adding the settings panel switch to "Hide local calendars", but this is a very, very difficult solution.
epologee
source share