Two "Calendar" entries listed on iPad - can't write to calendar using EventKit
- by Neal
My iOS app integrates with the device's calendar. On my iPad when I view the calendar app and tap the Calendars button on the top left to choose which calendars to show I see one entry named "Calendar". In my app when I loop through available calendars per the code below "Calendar" is listed twice. One is CalDAV for the type, the other is Local. I'm unable to create calendar entries in one of them, I believe the "Local" one, not sure why.
Why do I see "Calendar" listed twice when I do NOT see it listed twice in the iCal app?
public static List<string> Calendars
{
get
{
var calendars = new List<string>();
var ekCalendars = EventStore.Calendars;
if (ekCalendars != null && ekCalendars.Length > 0)
{
foreach (EKCalendar cal in ekCalendars)
{
if (cal.AllowsContentModifications)
calendars.Add(cal.Title);
}
calendars.Sort();
}
return calendars;
}
}