Returns a date representing the absolute time calculated by adding the value of a given component to a given date.
- iOS 8.0+
- macOS 10.9+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The unit to use for the calculation. For possible values, see
The value for the given unit.
The date to use to perform the calculation.
Options for the calculation. See
NSCalendarfor possible values.
If you specify a “wrap” option (
wrap), the specified components are incremented and wrap around to zero/one on overflow, but do not cause higher units to be incremented. When the wrap option is false, overflow in a unit carries into the higher units, as in typical addition.
NSDate object representing the absolute time calculated by adding to
value of the given calendrical
unit using the options specified by
date falls outside the defined range of the receiver or if the computation cannot be performed.