Required Instance Methodswift 6.0.3Swift
swapAt(_:_:)
Exchanges the values at the specified indices of the collection.
mutating func swapAt(_ i: Self.Index, _ j: Self.Index)
Parameters
Both parameters must be valid indices of the collection and not equal to endIndex
. Passing the same index as both i
and j
has no effect.