<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVKit",
  "identifier" : "/documentation/AVKit/AVPlayerViewControllerDelegate/playerViewController(_:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVKit"
    ],
    "preciseIdentifier" : "c:objc(pl)AVPlayerViewControllerDelegate(im)playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:"
  },
  "title" : "playerViewController(_:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:)"
}
-->

# playerViewController(_:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:)

Tells the delegate when Picture in Picture is about to stop so you can restore your app’s user interface.

```
optional func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping @Sendable (Bool) -> Void)
```

## Parameters

`playerViewController`

The player view controller.

`completionHandler`

You must call the completion handler with a value of `true` to allow the system to finish restoring your app’s user interface.

## Discussion

Implement this method to reestablish your playback user interface when PiP ends. The framework calls this method no matter how PiP ends, whether it’s because the user ended playback, the user tapped the button to return ongoing video playback to your app, or the video finished playing on its own.

---

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)