Mac Developer Library

Developer

AppKit Framework Reference NSPopoverDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSPopoverDelegate

Inheritance


Not Applicable

Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.7 and later.

The NSPopoverDelegate protocol defines optional methods that can be implemented by an NSPopover delegate class to provide additional or custom functionality.

See NSPopover Class Reference for more information on popovers in general.

  • Detaches the popover creating a window containing the content.

    Declaration

    Swift

    optional func detachableWindowForPopover(_ popover: NSPopover) -> NSWindow?

    Objective-C

    - (NSWindow *)detachableWindowForPopover:(NSPopover *)popover

    Parameters

    popover

    The popover.

    Return Value

    Returns a window instance to which the popover should be detached.

    Discussion

    You should not remove the popover's content view as part of your implementation of this method.

    The popover and the detachable window may be shown at the same time and therefore cannot share a content view or content view controller.

    If the popover and the detachable window should have the same content, you should define the content in a separate nib file and use a view controller to instantiate separate copies of the content for the popover and the detachable window.

    The popover will animate to appear as though it morphs into the detachable window (unless the popover’s animates property is set to NOfalse). The exact animation used is not guaranteed.

    If there is no delegate, the delegate does not implement this method, or the delegate returns nil, the popup will not be displayed detached.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.7 and later.