<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Calendar/MatchingPolicy",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation8CalendarV14MatchingPolicyO"
  },
  "title" : "Calendar.MatchingPolicy"
}
-->

# Calendar.MatchingPolicy

A hint to the search algorithm to control the method used for searching for dates.

```
enum MatchingPolicy
```

## Topics

### Enumeration Cases

[`Calendar.MatchingPolicy.nextTime`](/documentation/Foundation/Calendar/MatchingPolicy/nextTime)

If there is no matching time before the end of the next instance of the next higher component to the highest specified component in the `DateComponents` argument, the algorithm will return the next existing time which exists.

[`Calendar.MatchingPolicy.nextTimePreservingSmallerComponents`](/documentation/Foundation/Calendar/MatchingPolicy/nextTimePreservingSmallerComponents)

If specified, and there is no matching time before the end of the next instance of the next higher component to the highest specified component in the `DateComponents` argument, the method returns the next existing value of the missing component and preserves the lower components’ values (for example, no 2:37am results in 3:37am, if that exists).

[`Calendar.MatchingPolicy.previousTimePreservingSmallerComponents`](/documentation/Foundation/Calendar/MatchingPolicy/previousTimePreservingSmallerComponents)

If there is no matching time before the end of the next instance of the next higher component to the highest specified component in the `DateComponents` argument, the algorithm will return the previous existing value of the missing component and preserves the lower components’ values.

[`Calendar.MatchingPolicy.strict`](/documentation/Foundation/Calendar/MatchingPolicy/strict)

If specified, the algorithm travels as far forward or backward as necessary looking for a match.



---

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)