Contents

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 NSOrderedAscending if the first element is smaller than the second, NSOrderedDescending if the first element is larger than the second, and NSOrderedSame if 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.

See Also

Related Documentation

Laying Out the Cells of the Matrix