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
contextwhich may be arbitrary data used to help in the comparison. The comparator function should returnNSOrderedAscendingif the first subview should be ordered lower,NSOrderedDescendingif the second subview should be ordered lower, andNSOrderedSameif their ordering isn’t important. - context:
Arbitrary data that might help the comparator function
comparein its decisions.