popoverShouldDetach(_:)
Returns a Boolean value that indicates whether a popover should detach from its positioning view and become a separate window.
Declaration
@MainActor optional func popoverShouldDetach(_ popover: NSPopover) -> BoolParameters
- popover:
The popover that may be detached.
Discussion
If you don’t implement this method, it returns false by default. If you return true from this method, but you don’t implement detachableWindow(for:) or you implement it to return nil, a detachable window is created with the popover’s contentViewController.
An automatically created window has the same appearance as the detached popover. For example, if the popover’s contentViewController has a title, it will be bound to and displayed as the title of the detached window. When a popover is released in a detached state, it calls popoverDidDetach(_:) on the delegate. When a detached popover is closed, calls to popoverShouldClose(_:), popoverWillClose(_:), and popoverDidClose(_:), in addition to the related notifications, specify the reason standard.