Skip to content

Case

Calendar.MatchingPolicy.strict

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
If specified, the algorithm travels as far forward or backward as necessary looking for a match.
case strict

Discussion

For example, if searching for Feb 29 in the Gregorian calendar, the algorithm may choose March 1 instead (for example, if the year is not a leap year). If you wish to find the next Feb 29 without the algorithm adjusting the next higher component in the specified DateComponents, then use the strict option.

Note

There are ultimately implementation-defined limits in how far distant the search will go.