Article

Accessing the Event Store

Request access to a user's calendar data through the event store.

Overview

Your app must obtain permission from the user before accessing the calendar database: an app must never directly modify the calendar database on its own. EKEventStore is the application’s point of contact for accessing calendar and reminder data.

Connect to the Event Store

To receive event data in iOS, you must request access to an entity type after initializing the event store with requestAccess(to:completion:).

Connect to the event store with the following initializer:

EKEventStore *store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskReminder];
var store = EKEventStore(accessToEntityTypes: .reminder)

Releasing an event store instance before other EventKit objects may result in an error.

Protect User Privacy with Info.plist Keys

An iOS app linked on or after iOS 10.0 must include in its Info.plist file the usage description keys for the types of data it needs to access. To access the user's calendar events, reminders, and contacts through EventKitUI, you need to include descriptions for:

The EventKitUI framework may need to access Contacts data to choose the correct display name or avatar for a contact in a calendar.

Because these keys provide access to the event store, they protect the user's privacy by only allowing access to this information if the user grants permission explicitly in the app.

To access the user’s Calendar data, all sandboxed macOS apps must include the com.apple.security.personal-information key.

See Also

First Steps

class EKEventStore

An object that accesses the user’s calendar and reminder events and supports the scheduling of new events.