Instance Method

previewingContext(_:commit:)

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

Required.

Declaration

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

See Also

Providing Preview and Commit Views for 3D Touch

func previewingContext(UIViewControllerPreviewing, viewControllerForLocation: CGPoint) -> UIViewController?

Called when the user has pressed a source view in a previewing view controller, thereby obtaining a surrounding blur to indicate that a preview (peek) is available.

Required.