Contents

sortSubviews(_:context:)

Orders the view’s immediate subviews using the specified comparator function.

Declaration

func sortSubviews(_ compare: (NSView, NSView, UnsafeMutableRawPointer?) -> ComparisonResult, context: UnsafeMutableRawPointer?)

Parameters

  • compare:

    A pointer to the comparator function. This function must take as arguments two subviews to be ordered and contextual data (supplied in context which may be arbitrary data used to help in the comparison. The comparator function should return NSOrderedAscending if the first subview should be ordered lower, NSOrderedDescending if the second subview should be ordered lower, and NSOrderedSame if their ordering isn’t important.

  • context:

    Arbitrary data that might help the comparator function compare in its decisions.

See Also

Related Documentation

Adding and Removing Subviews