---
title: "popoverShouldDetach(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspopoverdelegate/popovershoulddetach(_:)"
---

# popoverShouldDetach(_:)

Returns a Boolean value that indicates whether a popover should detach from its positioning view and become a separate window.

## Declaration

```swift
@MainActor optional func popoverShouldDetach(_ popover: NSPopover) -> Bool
```

## Parameters

- `popover`: The popover that may be detached.

## Discussion

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.

## See Also

### Popover Visibility

- [popoverShouldClose(_:)](appkit/nspopoverdelegate/popovershouldclose(_:).md)
- [popoverWillShow(_:)](appkit/nspopoverdelegate/popoverwillshow(_:).md)
- [popoverDidShow(_:)](appkit/nspopoverdelegate/popoverdidshow(_:).md)
- [popoverWillClose(_:)](appkit/nspopoverdelegate/popoverwillclose(_:).md)
- [popoverDidClose(_:)](appkit/nspopoverdelegate/popoverdidclose(_:).md)
- [popoverDidDetach(_:)](appkit/nspopoverdelegate/popoverdiddetach(_:).md)
