Mac Developer Library

Developer

AppKit Framework Reference NSStackViewDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSStackViewDelegate

Inheritance


Not Applicable

Conforms To


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.9 and later.

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.

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

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

    Declaration

    Swift

    optional func stackView(_ stackView: NSStackView, didReattachViews views: [AnyObject])

    Objective-C

    - (void)stackView:(NSStackView *)stackView didReattachViews:(NSArray *)views

    Parameters

    stackView

    The stack view that has reattached one or more detached views.

    views

    An array of one or more views, managed by the stack view, that were reattached.

    Discussion

    To configure a custom class to respond to the automatic reattachment of views to a stack view’s view hierarchy, implement this method in the class. This method is not called when your code explicitly adds a view to a stack view’s views array.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.9 and later.

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

    Declaration

    Swift

    optional func stackView(_ stackView: NSStackView, willDetachViews views: [AnyObject])

    Objective-C

    - (void)stackView:(NSStackView *)stackView willDetachViews:(NSArray *)views

    Parameters

    stackView

    The stack view that is about to detach one or more of its views.

    views

    An array of one or more views, managed by the stack view, that are about to be automatically detached.

    Discussion

    To configure a custom class to respond to the automatic detachment of views from a stack view’s view hierarchy, implement this method in the class. This method is not called when your code explicitly removes a view from a stack view’s views array.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.9 and later.