Contents

setValue(_:forComponent:)

Sets a value for a given calendar unit.

Declaration

func setValue(_ value: Int, forComponent unit: NSCalendar.Unit)

Parameters

  • value:

    The value to set for the unit component.

  • unit:

    The calendar unit for which to set value. Do not pass Calendar or Timezone.

Discussion

This method allows for component values to be set for an NSCalendar.Unit value.

See Also

Accessing Components as Calendrical Units