Instance Method

setHoldingPriority(_:forSubviewAt:)

Sets the priority under which split view subviews maintain their width or height.

Declaration

func setHoldingPriority(_ priority: NSLayoutConstraint.Priority, forSubviewAt subviewIndex: Int)

Parameters

priority

The priority.

subviewIndex

The index of the subview

Discussion

Sets the priority under which split view subviews hold their widths (for a vertical split view) or height (for a horizontal split view). The view with the lowest priority will be the first to take on additional width if the split view grows or shrinks.

The default is NSLayoutPriorityDefaultLow. There is no reason to use the default, but you should use priorities less than NSLayoutPriorityDragThatCannotResizeWindow.

See Also

Managing Subviews

func adjustSubviews()

Adjusts the sizes of the split view’s subviews so they (plus the dividers) fill the split view.

func isSubviewCollapsed(NSView) -> Bool

Returns whether the specified view is collapsed.

func holdingPriorityForSubview(at: Int) -> NSLayoutConstraint.Priority

Returns the priority of the subview’s width or height when resizing.