Instance Method

requestAccessToEntityType:completion:

Prompts the user to grant or deny access to event or reminder data.

Declaration

- (void)requestAccessToEntityType:(EKEntityType)entityType completion:(EKEventStoreRequestAccessCompletionHandler)completion;

Parameters

entityType

The event or reminder entity type.

completion

The block to call when the request completes.

Discussion

In iOS 6 and later, requesting access to an event store asynchronously prompts your users for permission to use their data. The user is only prompted the first time your app requests access to an entity type; any subsequent instantiations of EKEventStore uses existing permissions. When the user taps to grant or deny access, the completion handler will be called on an arbitrary queue. Your app is not blocked while the user decides to grant or deny permission.

After users choose their permission level, the event store either calls the completion handler or broadcasts an EKEventStoreChangedNotification. The completion handler is called on iOS 6 and later, and the notification is broadcasted on iOS 5. Because users may deny access to the event store, your app should handle an empty data case.

See Also

Accessing the Event Store

EKAuthorizationStatus

The current authorization status for a specific entity type.

EKEventStoreRequestAccessCompletionHandler

The signature for a block object used for operating on events with the requestAccessToEntityType:completion: method.

EKEventSearchCallback

The signature for a block object used for operating on events with the enumerateEventsMatchingPredicate:usingBlock: method.

- initWithAccessToEntityTypes:

Initializes access to the event store with support for the given entity type.

Deprecated
+ authorizationStatusForEntityType:

Returns the authorization status for the given entity type.

eventStoreIdentifier

The unique identifier for the event store.