<!--
{
  "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/predicateForEvents(withStart:end:calendars:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "EventKit"
    ],
    "preciseIdentifier" : "c:objc(cs)EKEventStore(im)predicateForEventsWithStartDate:endDate:calendars:"
  },
  "title" : "predicateForEvents(withStart:end:calendars:)"
}
-->

# predicateForEvents(withStart:end:calendars:)

Creates a predicate to identify events that occur within a given date range.

```
func predicateForEvents(withStart startDate: Date, end endDate: Date, calendars: [EKCalendar]?) -> NSPredicate
```

## Parameters

`startDate`

The start date of the range of events fetched.

`endDate`

The end date of the range of events fetched.

`calendars`

An array of calendars to search, or `nil` to search all calendars.

## Return Value

A predicate to use when calling [`enumerateEvents(matching:using:)`](/documentation/EventKit/EKEventStore/enumerateEvents(matching:using:)) or [`events(matching:)`](/documentation/EventKit/EKEventStore/events(matching:)).

## Discussion

Use this method to create a predicate for use with [`events(matching:)`](/documentation/EventKit/EKEventStore/events(matching:)) or [`enumerateEvents(matching:using:)`](/documentation/EventKit/EKEventStore/enumerateEvents(matching:using:)). The events returned using this predicate are in the default time zone. For performance reasons, this method matches only those events within a four-year time span. If the date range between `startDate` and `endDate` is greater than four years, it’s shortened to the first four years.

---

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)