<!--
{
  "availability" : [
    "iOS: 9.0.0 - 13.0.0",
    "iPadOS: 9.0.0 - 13.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "tvOS: 9.0.0 - 13.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewControllerPreviewingDelegate/previewingContext(_:commit:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIViewControllerPreviewingDelegate(im)previewingContext:commitViewController:"
  },
  "title" : "previewingContext(_:commit:)"
}
-->

# previewingContext(_:commit:)

Called to let you prepare the presentation of a commit (pop) view from your commit view controller.

```
func previewingContext(_ previewingContext: any UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController)
```

## Parameters

`previewingContext`

The context object for the previewing view controller.

`viewControllerToCommit`

The view controller whose view your implementation of this method is moving into place as a commit (pop) view.

## Discussion

Implement this method to configure and present the commit (pop) view controller, in a way that is appropriate for your app.

For example, to present the commit view controller’s view in a navigation controller, call the navigation controller’s [`show(_:sender:)`](/documentation/UIKit/UINavigationController/show(_:sender:)) method; to present the view modally, you could call the [`present(_:animated:completion:)`](/documentation/UIKit/UIViewController/present(_:animated:completion:)) method.

---

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)