Protocol

UIViewControllerPreviewing

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

Declaration

@protocol UIViewControllerPreviewing

Overview

The system returns a context object conforming to this protocol when you call a view controller’s registerForPreviewingWithDelegate: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.

Topics

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

sourceRect

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.

Required.

previewingGestureRecognizerForFailureRelationship

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

Required.

Accessing Properties of a 3D Touch Previewing View Controller

delegate

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

Required.

sourceView

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

Required.

Relationships

Inherits From

See Also

Deprecated Protocols

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.

UIAccelerometerDelegate

The UIAccelerometerDelegate protocol defines a single method for receiving acceleration-related data from the system. Implementation of this method is optional, but expected.

Deprecated
UIActionSheetDelegate

Important: UIActionSheetDelegate is deprecated in iOS 8. (Note that UIActionSheet is also deprecated.) To create and manage action sheets in iOS 8 and later, use UIAlertController.

UIAlertViewDelegate

For apps that run in versions of iOS prior to iOS 8, the UIAlertViewDelegate protocol defines the methods a delegate of a UIAlertView object should implement. The delegate implements the button actions and any other custom behavior. Some of the methods defined in this protocol are optional.

UIPopoverControllerDelegate

The UIPopoverControllerDelegate protocol defines the methods you can implement for the delegate of a UIPopoverController object. Popover controllers notify their delegate whenever user interactions would cause the dismissal of the popover and, in some cases, give the user a chance to prevent that dismissal.

UISearchDisplayDelegate

Important: UISearchDisplayDelegate is deprecated in iOS 8. (Note that UISearchDisplayController is also deprecated.) To manage the presentation of a search bar and display search results in iOS 8 and later, instead use UISearchControllerDelegate.