<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopover/willCloseNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@NSPopoverWillCloseNotification"
  },
  "title" : "willCloseNotification"
}
-->

# willCloseNotification

Sent before the popover is closed.

```
class let willCloseNotification: NSNotification.Name
```

## Discussion

The `userInfo` key [`closeReasonUserInfoKey`](/documentation/AppKit/NSPopover/closeReasonUserInfoKey) specifies the reason for closing. It can currently be either [`standard`](/documentation/AppKit/NSPopover/CloseReason/standard) or [`detachToWindow`](/documentation/AppKit/NSPopover/CloseReason/detachToWindow), although more reasons for closing may be added in the future.

To observe this notification using Swift concurrency, use [`NSPopover.WillCloseMessage`](/documentation/AppKit/NSPopover/WillCloseMessage).

---

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)