An object that accesses the user’s calendar and reminder events and supports the scheduling of new events.
SDKs
- iOS 4.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- watchOS 2.0+
Framework
- Event
Kit
Declaration
class EKEventStore : NSObject
Overview
The EKEvent
class is an application’s point of contact for accessing calendar and reminder data.
In iOS, you must request access to an entity type after the event store is initialized with request
for data to return.
Important
An iOS app linked on or after iOS 10.0 must include in its Info
file the usage description keys for the types of data it needs to access or it will crash. To access Reminders and Calendar data specifically, it must include NSRemindersUsageDescription and NSCalendarsUsageDescription, respectively.
To access the user’s Calendar data, all sandboxed macOS apps must include the com
entitlement. To learn more about entitlements related to App Sandbox, see Enabling App Sandbox.
In macOS, use init
instead of the default init
method. Acceptable entity types are event
for events and reminder
for reminders.
Create a predicate, or a search query for events, with the predicate
method.
Fetch and process events that match a given predicate with the events(matching:)
and enumerate
methods.
Save and delete events from the event store with the save(_:
and remove(_:
methods.
Use similar methods to access and manipulate reminders. Reminders are not available in Event Kit before iOS 6.