To configure a custom class to respond to a view detaching from, or reattaching to, a stack view (an instance of the NSStackView class), configure the custom class to adopt the NSStackViewDelegate protocol. Then, in a stack view instance, set the delegate property to refer to an instance of your custom class.


protocol NSStackViewDelegate


For an explanation of detachment and reattachment of a stack view’s views, see the Overview in NSStackView.


Responding to View Detachment and Reattachment

func stackView(NSStackView, didReattach: [NSView])

Called when the stack view has automatically reattached one or more previously-detached views.

func stackView(NSStackView, willDetach: [NSView])

Called when the stack view is about to automatically detach one or more of its views.


Inherits From

See Also

Responding to Stack-Related Changes

var delegate: NSStackViewDelegate?

The delegate object for the stack view.