Contents

sort(using:)

Sorts the receiver’s cells in ascending order as defined by the comparison method.

Declaration

func sort(using comparator: Selector)

Parameters

  • comparator:

    The comparison method.

Discussion

The comparator message is sent to each object in the matrix and has as its single argument another object in the array. The comparison method is used to compare two elements at a time and should return NSOrderedAscending if the receiver is smaller than the argument, NSOrderedDescending if the receiver is larger than the argument, and NSOrderedSame if they are equal.

See Also

Related Documentation

Laying Out the Cells of the Matrix