---
title: "dismiss(animated:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uipopovercontroller/dismiss(animated:)"
---

# dismiss(animated:)

Dismisses the popover programmatically.

## Declaration

```swift
func dismiss(animated: Bool)
```

## Parameters

- `animated`: Specify doc://com.apple.documentation/documentation/Swift/true to animate the dismissal of the popover or doc://com.apple.documentation/documentation/Swift/false to dismiss it immediately.

## Discussion

Discussion You can use this method to dismiss the popover programmatically in response to taps inside the popover window. Taps outside of the popover’s contents automatically dismiss the popover.

## See Also

### Presenting and dismissing the popover

- [present(from:in:permittedArrowDirections:animated:)](uikit/uipopovercontroller/present(from:in:permittedarrowdirections:animated:).md)
- [present(from:permittedArrowDirections:animated:)](uikit/uipopovercontroller/present(from:permittedarrowdirections:animated:).md)
