<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "EventKit",
  "identifier" : "/documentation/EventKit/EKEventStore/enumerateEvents(matching:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "EventKit"
    ],
    "preciseIdentifier" : "c:objc(cs)EKEventStore(im)enumerateEventsMatchingPredicate:usingBlock:"
  },
  "title" : "enumerateEvents(matching:using:)"
}
-->

# enumerateEvents(matching:using:)

Finds all events that match a given predicate and calls a given callback for each event found.

```
func enumerateEvents(matching predicate: NSPredicate, using block: @escaping EKEventSearchCallback)
```

## Parameters

`predicate`

A search predicate created with [`predicateForEvents(withStart:end:calendars:)`](/documentation/EventKit/EKEventStore/predicateForEvents(withStart:end:calendars:)).

`block`

The closure to call for each event. The callback must match the signature defined by [`EKEventSearchCallback`](/documentation/EventKit/EKEventSearchCallback).

## Discussion

Only committed events are included in the enumeration. To include events saved using [`save(_:span:commit:)`](/documentation/EventKit/EKEventStore/save(_:span:commit:)) with the `commit` parameter set to <doc://com.apple.documentation/documentation/Swift/false>, call [`commit()`](/documentation/EventKit/EKEventStore/commit()) first.

This method is synchronous. For asynchronous behavior, run the method on another thread with <doc://com.apple.documentation/documentation/Dispatch/dispatch_async> or <doc://com.apple.documentation/documentation/Foundation/Operation>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)