---
title: "previewingContext(_:commit:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiviewcontrollerpreviewingdelegate/previewingcontext(_:commit:)"
---

# previewingContext(_:commit:)

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

## Declaration

```swift
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

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:) method; to present the view modally, you could call the present(_:animated:completion:) method.

## See Also

### Providing preview and commit views for 3D Touch

- [previewingContext(_:viewControllerForLocation:)](uikit/uiviewcontrollerpreviewingdelegate/previewingcontext(_:viewcontrollerforlocation:).md)
