Instance Property


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



var sourceView: UIView { get }


Set the value of this property when you register a view controller to participate in 3D Touch. Do this in the view controller’s registerForPreviewing(with:sourceView:) method.

When the user begins to press on the source view, the system blurs the surrounding area to let the user know that a preview (peek) is available. At this time, the system calls your previewingContext(_:viewControllerForLocation:) method to let you prepare the presentation of a preview. If the user presses more deeply, the system presents the preview defined in your delegate method.

If the user presses deeper on the preview, the system navigates to the view you’ve specified in your previewingContext(_:commit:) method. The commit view then fills the bounds of the app’s window.

See Also

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.