Instance Method

eventsMatchingPredicate:

Returns all events that match a given predicate.

Declaration

- (NSArray<EKEvent *> *)eventsMatchingPredicate:(NSPredicate *)predicate;

Parameters

predicate

The search predicate. Must be created with the predicateForEventsWithStartDate:endDate:calendars: method.

Return Value

All events that match predicate, as an array of EKEvent objects.

Discussion

Only events that have been committed are included in the results. Events saved using saveEvent:span:commit:error: with the commit parameter set to NO must call commit: beforehand to be included.

This method is synchronous. For asynchronous behavior, run the method on another thread with dispatch_async or NSOperation.

See Also