---
title: "events(matching:)"
framework: EventKit
role: symbol
role_heading: Instance Method
platforms: [iOS 4.0+, iPadOS 4.0+, Mac Catalyst 13.1+, macOS 10.8+, visionOS 1.0+, watchOS 2.0+]
path: eventkit/ekeventstore/1507183-events
---

# events(matching:)

Finds all events that match a given predicate.

## Declaration

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

## Parameters

- `predicate`: A search predicate created with [doc://com.apple.eventkit/documentation/EventKit/EKEventStore/predicateForEvents(withStart:end:calendars:)](eventkit/ekeventstore/predicateforevents(withstart:end:calendars:).md).

## Return Value

An array of events that match `predicate`.

## Discussion

Only committed events are included in the results. To include events saved using [save(_:span:commit:)](save(_:span:commit:).md) with the `commit` parameter set to [false](../../swift/false.md), call [commit()](commit().md) first.

This method is synchronous. For asynchronous behavior, run the method on another thread with [dispatch_async](../../dispatch/dispatch_async.md) or [Operation](../../foundation/operation.md).

## See Also

### Searching calendars

- [enumerateEvents(matching:using:)](enumerateevents(matching:using:).md)
- [fetchReminders(matching:completion:)](fetchreminders(matching:completion:).md)
- [cancelFetchRequest(_:)](cancelfetchrequest(_:).md)
- [predicateForEvents(withStart:end:calendars:)](predicateforevents(withstart:end:calendars:).md)
- [predicateForReminders(in:)](predicateforreminders(in:).md)
- [predicateForCompletedReminders(withCompletionDateStarting:ending:calendars:)](predicateforcompletedreminders(withcompletiondatestarting:ending:calendars:).md)
- [predicateForIncompleteReminders(withDueDateStarting:ending:calendars:)](predicateforincompletereminders(withduedatestarting:ending:calendars:).md)
- [EKEventSearchCallback](../ekeventsearchcallback.md)
