Instance Method
distance(from:to:)
Returns the distance between two indices.
Declaration
func distance(from start: Int, to end: Int) -> Int
Parameters
startA valid index of the collection.
endAnother valid index of the collection. If end is equal to start, the result is zero.
Return Value
The distance between start and end.