enumerateEvents(matching:using:)
Finds all events that match a given predicate and calls a given callback for each event found.
Declaration
func enumerateEvents(matching predicate: NSPredicate, using block: @escaping EKEventSearchCallback)Parameters
- predicate:
A search predicate created with Predicateforevents(withstart:end:calendars:).
- block:
The closure to call for each event. The callback must match the signature defined by Ekeventsearchcallback.
Discussion
Only committed events are included in the enumeration. To include events saved using save(_:span:commit:) with the commit parameter set to false, call commit() first.
This method is synchronous. For asynchronous behavior, run the method on another thread with dispatch_async or Operation.
See Also
Searching calendars
events(matching:)fetchReminders(matching:completion:)cancelFetchRequest(_:)predicateForEvents(withStart:end:calendars:)predicateForReminders(in:)predicateForCompletedReminders(withCompletionDateStarting:ending:calendars:)predicateForIncompleteReminders(withDueDateStarting:ending:calendars:)EKEventSearchCallback