Search code examples
iosiphoneios6icalendar

how to create a calendar in the native iOS 6 calendars app?


I have a requirement where in I need to set up reminders / events, but they shouldn't be in the default calendar. So I was looking for a way to add a custom calendar to the native calendar app in iPhone. But on looking up the EventKit framework I learned that the method " calendarWithEventStore: " has been deprecated since iOS 6. Is there any other way or work around for this.


Solution

  • Use calendarForEntityType:eventStore: instead, which allows specifying the entity type as well (events or reminders). Note that to support iOS 5 and earlier, you must check if this method is NULL before calling it (or fall back to the old calendarWithEventStore:).