A set of methods that define the interface for configuring a previewing view controller on devices that support 3D Touch.


protocol UIViewControllerPreviewing


The system returns a context object conforming to this protocol when you call a view controller’s registerForPreviewing(with:sourceView:) method. This method registers the view controller to participate in 3D Touch preview (peek) and commit (pop) behaviors.

To learn about 3D Touch, read Adopting 3D Touch on iPhone.


Configuring a Source View for a 3D Touch Previewing View Controller

var sourceRect: CGRect

The rectangle, in the source view’s coordinate system, that responds to a 3D Touch by a user and remains visually sharp while surrounding content blurs.


var previewingGestureRecognizerForFailureRelationship: UIGestureRecognizer

A gesture recognizer suitable for setting up failure requirements for a preview’s (peek’s) gestures.


Accessing Properties of a 3D Touch Previewing View Controller

var delegate: UIViewControllerPreviewingDelegate

The previewing view controller's delegate for managing preview (peek) and commit (pop) view controllers.


var sourceView: UIView

A source view, in a previewing view controller’s view hierarchy, responds to a 3D Touch by the user.



Inherits From

See Also

First Steps

Implementing Peek and Pop

Accelerate actions in your app by providing shortcuts to preview content in detail view controllers.

protocol UIViewControllerPreviewingDelegate

A set of methods used by the delegate to respond, with a preview view controller and a commit view controller, to the user pressing a view object on the screen of a device that supports 3D Touch.