Contents

range(of:start:interval:for:)

Returns by reference the starting time and duration of a given calendar unit that contains a given date.

Declaration

func range(of unit: NSCalendar.Unit, start datep: AutoreleasingUnsafeMutablePointer<NSDate?>?, interval tip: UnsafeMutablePointer<TimeInterval>?, for date: Date) -> Bool

Parameters

  • unit:

    A calendar unit (see Unit for possible values).

  • datep:

    Upon return, contains the starting time of the calendar unit unit that contains the date date

  • tip:

    Upon return, contains the duration of the calendar unit unit that contains the date date

  • date:

    A date.

Return Value

true if the starting time and duration of a unit could be calculated, otherwise false.

See Also

Getting Calendar Information