Instance Method

events(matching:)

Returns all events that match a given predicate.

Declaration

func events(matching predicate: NSPredicate) -> [EKEvent]

Parameters

predicate

The search predicate. Must be created with the predicateForEvents(withStart:end: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 save(_:span:commit:) with the commit parameter set to false must call commit() beforehand to be included.

This method is synchronous. For asynchronous behavior, run the method on another thread with dispatch_async(_:_:) or Operation.

See Also

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software