---
title: "playerViewControllerShouldDismiss(_:)"
framework: avkit
role: symbol
role_heading: Instance Method
path: "avkit/avplayerviewcontrollerdelegate/playerviewcontrollershoulddismiss(_:)"
---

# playerViewControllerShouldDismiss(_:)

Asks the delegate object whether the player view controller dismisses itself upon request.

## Declaration

```swift
optional func playerViewControllerShouldDismiss(_ playerViewController: AVPlayerViewController) -> Bool
```

## Parameters

- `playerViewController`: The player view controller.

## Return Value

Return Value true if the player view controller should dismiss itself; otherwise false.

## Discussion

Discussion If allowed, the player view controller dismisses itself with animation. If you’ve embedded the player view controller in another view, the delegate may need to manually dismiss the view controller.

## See Also

### Dismissing the Player View Controller

- [playerViewControllerWillBeginDismissalTransition(_:)](avkit/avplayerviewcontrollerdelegate/playerviewcontrollerwillbegindismissaltransition(_:).md)
- [playerViewControllerDidEndDismissalTransition(_:)](avkit/avplayerviewcontrollerdelegate/playerviewcontrollerdidenddismissaltransition(_:).md)
