Tutorial by Examples

Your app can't access your reminders and your calendar without permission. Instead, it must show an alert to user, requesting him/her to grant access to events for the app. To get started, import the EventKit framework: Swift import EventKit Objective-C #import <EventKit/EventKit.h> ...
Accessing the array of calendars To access the array of EKCalendars, we use the calendarsForEntityType method: Swift let calendarsArray = eventStore.calendarsForEntityType(EKEntityType.Event) as! [EKCalendar] Iterating through calendars Just use a simple for loop: Swift for calendar in cale...
Creating the event object Swift var event = EKEvent(eventStore: eventStore) Objective-C EKEvent *event = [EKEvent initWithEventStore:eventStore]; Setting related calendar, title and dates Swift event.calendar = calendar event.title = "Event Title" event.startDate = startDate /...

Page 1 of 1