<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSCalendar/Options",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSCalendarOptions"
  },
  "title" : "NSCalendar.Options"
}
-->

# NSCalendar.Options

The options for arithmetic operations involving calendars.

```
struct Options
```

## Topics

### Initializers

[`init(rawValue:)`](/documentation/Foundation/NSCalendar/Options/init(rawValue:))

### Constants

[`NSCalendarWrapComponents`](/documentation/Foundation/NSCalendar/Options/wrapComponents)

Specifies that the components specified for an `NSDateComponents` object should be incremented and wrap around to zero/one on overflow, but should not cause higher units to be incremented.

[`NSCalendarMatchStrictly`](/documentation/Foundation/NSCalendar/Options/matchStrictly)

Specifies that the operation should travel as far forward or backward as necessary looking for a match.

[`NSCalendarSearchBackwards`](/documentation/Foundation/NSCalendar/Options/searchBackwards)

Specifies that the operation should travel backwards to find the previous match before the given date.

[`NSCalendarMatchPreviousTimePreservingSmallerUnits`](/documentation/Foundation/NSCalendar/Options/matchPreviousTimePreservingSmallerUnits)

Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given `NSDateComponents` object, this method uses the *previous* existing value of the missing unit and preserves the lower units’ values.

[`NSCalendarMatchNextTimePreservingSmallerUnits`](/documentation/Foundation/NSCalendar/Options/matchNextTimePreservingSmallerUnits)

Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given `NSDateComponents` object, this method uses the *next* existing value of the missing unit and preserves the lower units’ values.

[`NSCalendarMatchNextTime`](/documentation/Foundation/NSCalendar/Options/matchNextTime)

Specifies that, when there is no matching time before the end of the next instance of the next highest unit specified in the given `NSDateComponents` object, this method uses the *next* existing value of the missing unit and *does not* preserve the lower units’ values.

[`NSCalendarMatchFirst`](/documentation/Foundation/NSCalendar/Options/matchFirst)

Specifies that, if there are two or more matching times, the operation should return the first occurrence.

[`NSCalendarMatchLast`](/documentation/Foundation/NSCalendar/Options/matchLast)

Specifies that, if there are two or more matching times, the operation should return the last occurrence.

[`NSWrapCalendarComponents`](/documentation/Foundation/NSWrapCalendarComponents)

Specifies that the components specified for an `NSDateComponents` object should be incremented and wrap around to zero/one on overflow, but should not cause higher units to be incremented.

## Relationships

### Conforms To

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

[`Equatable`](/documentation/Swift/Equatable)

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`OptionSet`](/documentation/Swift/OptionSet)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Sendable`](/documentation/Swift/Sendable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)