<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSCalendar/nextDate(after:matching:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCalendar(im)nextDateAfterDate:matchingComponents:options:"
  },
  "title" : "nextDate(after:matching:options:)"
}
-->

# nextDate(after:matching:options:)

Returns the next date after a given date matching the given components.

```
func nextDate(after date: Date, matching comps: DateComponents, options: NSCalendar.Options = []) -> Date?
```

## Parameters

`date`

The date for which to perform the calculation.

`comps`

The date components to match.

`options`

Options for the calculation. For possible values, see [`NSCalendar.Options`](/documentation/Foundation/NSCalendar/Options).

## Return Value

A new `NSDate` object.

## Discussion

To compute a sequence of dates, use the [`enumerateDates(startingAfter:matching:options:using:)`](/documentation/Foundation/NSCalendar/enumerateDates(startingAfter:matching:options:using:)) method instead of calling this method in a loop with the previous loop iteration’s result.

---

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)