sort(using:context:)
Sorts the receiver’s cells in ascending order as defined by the specified comparison function.
Declaration
func sort(using compare: (Any, Any, UnsafeMutableRawPointer?) -> Int, context: UnsafeMutableRawPointer?)Parameters
- compare:
The function to use when comparing cells. The comparison function is used to compare two elements at a time and should return
NSOrderedAscendingif the first element is smaller than the second,NSOrderedDescendingif the first element is larger than the second, andNSOrderedSameif the elements are equal. - context:
Context passed to the comparison function as its third argument, each time its called. This allows the comparison to be based on some outside parameter, such as whether character sorting is case-sensitive or case-insensitive.