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

# popoverShouldClose(_:)

Allows a delegate to override a close request.

## Declaration

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

## Parameters

- `popover`: The popover.

## Return Value

Return Value true if the popover should close, false otherwise.

## Discussion

Discussion The popover invokes this method on its delegate whenever it is about to close. This gives the delegate a chance to override the close. If there is no delegate or the delegate does not implement this method the default behavior is that the popover will close.

## See Also

### Popover Visibility

- [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)
- [popoverShouldDetach(_:)](appkit/nspopoverdelegate/popovershoulddetach(_:).md)
