Exchanges the values at two indices of an array.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
void CFArrayExchangeValuesAtIndices(CFMutable Array Ref theArray, CFIndex idx1, CFIndex idx2);
Parameters
theArray
The array that contains the values to be swapped.
idx1
The index of the value to swap with the value at
idx2
. The index must not exceed the index space ofthe
(Array 0
toN-1
inclusive, whereN
is the count ofthe
before the operation).Array idx2
The index of the value to swap with the value at
idx1
. The index must not exceed the index space ofthe
(Array 0
toN-1
inclusive, whereN
is the count ofthe
before the operation).Array