stride

func stride<T where T : Strideable>(from: T, to: T, by: T.Stride)

Returns the sequence of values (self, self + stride, self + 2 * stride, ... last) where last is the last value in the progression that is less than end.

Declaration

func stride<T where T : Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T>
func stride<T where T : Strideable>(from: T, through: T, by: T.Stride)

Returns the sequence of values (self, self + stride, self + 2 * stride, ... last) where last is the last value in the progression less than or equal to end.

Note: There is no guarantee that end is an element of the sequence.

Declaration

func stride<T where T : Strideable>(from start: T, through end: T, by stride: T.Stride) -> StrideThrough<T>