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

# performClose(_:)

Attempts to close the popover.

```
@IBAction func performClose(_ sender: Any?)
```

## Parameters

`sender`

The sender of the action message.

## Discussion

The popover will not be closed if it has a delegate and the delegate implements the returns [`popoverShouldClose(_:)`](/documentation/AppKit/NSPopoverDelegate/popoverShouldClose(_:)) method returning <doc://com.apple.documentation/documentation/Swift/false>, or if a subclass of the NSPopover class implements `popoverShouldClose:` and returns <doc://com.apple.documentation/documentation/Swift/false>).

The operation will fail if the popover is displaying a nested popover or if it has a child window. A window will attempt to close its popovers when it receives a [`performClose(_:)`](/documentation/AppKit/NSWindow/performClose(_:)) message.

The popover animates out when closed unless the [`animates`](/documentation/AppKit/NSPopover/animates) property is set to <doc://com.apple.documentation/documentation/Swift/false>.

---

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)