<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopoverDelegate/popoverShouldDetach(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSPopoverDelegate(im)popoverShouldDetach:"
  },
  "title" : "popoverShouldDetach(_:)"
}
-->

# popoverShouldDetach(_:)

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

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

## Parameters

`popover`

The popover that may be detached.

## Discussion

If you don’t implement this method, it returns <doc://com.apple.documentation/documentation/Swift/false> by default. If you return <doc://com.apple.documentation/documentation/Swift/true> from this method, but you don’t implement [`detachableWindow(for:)`](/documentation/AppKit/NSPopoverDelegate/detachableWindow(for:)) or you implement it to return `nil`, a detachable window is created with the popover’s [`contentViewController`](/documentation/AppKit/NSPopover/contentViewController).

An automatically created window has the same appearance as the detached popover. For example, if the popover’s [`contentViewController`](/documentation/AppKit/NSPopover/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(_:)`](/documentation/AppKit/NSPopoverDelegate/popoverDidDetach(_:)) on the delegate. When a detached popover is closed, calls to [`popoverShouldClose(_:)`](/documentation/AppKit/NSPopoverDelegate/popoverShouldClose(_:)), [`popoverWillClose(_:)`](/documentation/AppKit/NSPopoverDelegate/popoverWillClose(_:)), and [`popoverDidClose(_:)`](/documentation/AppKit/NSPopoverDelegate/popoverDidClose(_:)), in addition to the related notifications, specify the reason [`standard`](/documentation/AppKit/NSPopover/CloseReason/standard).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)