dateInterval(of:start:interval:for:)
Returns, via two inout parameters, the starting time and duration of a given calendar component that contains a given date.
Declaration
func dateInterval(of component: Calendar.Component, start: inout Date, interval: inout TimeInterval, for date: Date) -> BoolParameters
- component:
A calendar component.
- start:
Upon return, the starting time of the calendar component that contains the date.
- interval:
Upon return, the duration of the calendar component that contains the date.
- date:
The specified date.
Return Value
true if the starting time and duration of a component could be calculated; otherwise, false.