CFArraySortValues(_:_:_:_:)
Sorts the values in an array using a given comparison function.
Declaration
func CFArraySortValues(_ theArray: CFMutableArray!, _ range: CFRange, _ comparator: CFComparatorFunction!, _ context: UnsafeMutableRawPointer!)Parameters
- theArray:
The array whose values are sorted.
- range:
The range of values within
theArrayto sort. The range location or end point (defined by the location plus length minus 1) must not lie outside the index space oftheArray(0toN-1inclusive, whereNis the count oftheArray). The range length must not be negative. The range may be empty (length 0). - comparator:
The function with the comparator function type signature that is used in the sort operation to compare the values in
theArray. If this parameter is not a pointer to a function of the correct prototype, the behavior is undefined. If there are values intheArraythat thecomparatorfunction does not expect or cannot properly compare, the behavior is undefined. The values in the range are sorted from least to greatest according to this function. - context:
A pointer-sized program-defined value, which is passed as the third parameter to the
comparatorfunction, but is otherwise unused by this function. If the context is not what is expected by thecomparatorfunction, the behavior is undefined.