---
title: "pictureInPictureController(_:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:)"
framework: avkit
role: symbol
role_heading: Instance Method
path: "avkit/avpictureinpicturecontrollerdelegate/pictureinpicturecontroller(_:restoreuserinterfaceforpictureinpicturestopwithcompletionhandler:)"
---

# pictureInPictureController(_:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:)

Tells the delegate to restore the user interface before Picture in Picture stops.

## Declaration

```swift
optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping @Sendable (Bool) -> Void)
```

```swift
optional func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController) async -> Bool
```

## Parameters

- `pictureInPictureController`: The delegating controller.
- `completionHandler`: You must call the completion handler with a value of true to allow the system to finish restoring your player user interface.

## Mentioned in

Adopting Picture in Picture in a Custom Player

## Discussion

Discussion Implement this method if your player user interface requires configuration or layout to return to its default state.
