<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPreviewInteractionDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIPreviewInteractionDelegate"
  },
  "title" : "UIPreviewInteractionDelegate"
}
-->

# UIPreviewInteractionDelegate

A set of methods for communicating the progress of a preview interaction.

```
@MainActor protocol UIPreviewInteractionDelegate : NSObjectProtocol
```

## Overview

A preview interaction abstracts a 3D Touch interaction into a state machine and communicates its progress through the state machine though a delegate. You’re responsible for implementing the appropriate UI behavior.

Create an object that conforms to this protocol and assign it to the [`delegate`](/documentation/UIKit/UIPreviewInteraction/delegate) property on an instance of [`UIPreviewInteraction`](/documentation/UIKit/UIPreviewInteraction). Use this delegate object to respond to the state changes that occur within the preview interaction as the user performs 3D Touch interactions.

### Control preview interaction state changes

The methods on [`UIPreviewInteractionDelegate`](/documentation/UIKit/UIPreviewInteractionDelegate) allow you to control whether a preview interaction is allowed to begin, and to observe its progress through the phases of a preview interaction. This allows you to provide a custom user experience while maintaining coherence with the system.

A preview interaction consists of two main phases: *preview* and *commit*. The following image is a visualization of the underlying state machine associated with a preview interaction.

![Flow diagram showing the four underlying states of a preview interaction: preview, commit, complete and canceled. Delegate methods communicate the transitions between these states.](images/com.apple.uikit/media-2825116@2x.png)

The [`previewInteractionShouldBegin(_:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteractionShouldBegin(_:)) method is called as the user begins to press on a view that has a preview interaction associated with it. Implement this method and return <doc://com.apple.documentation/documentation/Swift/false> to prevent the preview interaction from continuing. Returning <doc://com.apple.documentation/documentation/Swift/true>, or not implementing this optional method, will allow the preview interaction to continue.

Once a preview interaction begins, it enters the first phase — also called *preview* —_ _through which it progresses as the user presses harder on the view. During this phase, the [`previewInteraction(_:didUpdatePreviewTransition:ended:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteraction(_:didUpdatePreviewTransition:ended:)) method is called repeatedly, reporting the progress through the transition as a <doc://com.apple.documentation/documentation/CoreFoundation/CGFloat-swift.struct> with a value from `0` to `1`. Implement this method and use the `transitionProgress` parameter to update the UI, providing visual feedback to the user.

When the `ended` parameter changes from <doc://com.apple.documentation/documentation/Swift/false> to <doc://com.apple.documentation/documentation/Swift/true>, the preview interaction transitions to the second phase — *commit*. There are no further calls to the [`previewInteraction(_:didUpdatePreviewTransition:ended:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteraction(_:didUpdatePreviewTransition:ended:)) delegate method.

The progress through the *commit* phase is reported to the [`previewInteraction(_:didUpdateCommitTransition:ended:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteraction(_:didUpdateCommitTransition:ended:)) delegate method. Implement this method and use the `transitionP``rogress` parameter to update the UI appropriately. The preview interaction is said to be completed when the `ended` parameter is true, at which point you should complete any UI changes.

At any point before the preview interaction is completed, it can be canceled, either when the user lifts their finger from the screen, or when the [`cancel()`](/documentation/UIKit/UIPreviewInteraction/cancel()) method is called on the [`UIPreviewInteraction`](/documentation/UIKit/UIPreviewInteraction) instance. When this happens, the [`previewInteractionDidCancel(_:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteractionDidCancel(_:)) delegate method is called. You should use this method to cancel any UI transitions currently in progress.

### Preview interaction user interface updates

[`UIPreviewInteraction`](/documentation/UIKit/UIPreviewInteraction) abstracts 3D Touch interactions away from touch force, allowing you to provide your own user interface updates for an interaction pattern that’s well understood by people. The preview interaction sits between view controller previewing (*peek* and *pop*) and the force values in [`UITouch`](/documentation/UIKit/UITouch), in that you’re required to provide your own user interface updates but don’t need to handle raw touch force values.

It’s important that during the preview and commit phases, you update the UI in such a way that a person is aware that the interaction is taking place. For example, pressing a table row in the Mail app first progressively blurs the other rows (the preview phase), and then shows a popover of the email as the commit phase begins. Throughout the commit phase, the popover grows, before finally transitioning to the email detail view at the end of the commit phase.

You can provide any user experience you want to accompany the preview and commit phases, but be sure to follow the appropriate section on 3D Touch in the [iOS Human Interface Guidelines](https://developer.apple.com/ios/human-interface-guidelines/). Consider using [`UIViewPropertyAnimator`](/documentation/UIKit/UIViewPropertyAnimator) to implement the UI changes that track the progress through the preview and commit phases of the preview interaction. This class allows you to build an animation and then scrub through that animation, using the [`fractionComplete`](/documentation/UIKit/UIViewAnimating/fractionComplete) property. This maps perfectly to the `transitionProgress` property provided in the [`previewInteraction(_:didUpdatePreviewTransition:ended:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteraction(_:didUpdatePreviewTransition:ended:)) and [`previewInteraction(_:didUpdateCommitTransition:ended:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteraction(_:didUpdateCommitTransition:ended:)) methods, allowing you to use [`UIViewPropertyAnimator`](/documentation/UIKit/UIViewPropertyAnimator) to update the UI in response to a person’s touch force.

## Topics

### Managing preview interactions

[`previewInteractionShouldBegin(_:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteractionShouldBegin(_:))

Asks the delegate whether a preview interaction is allowed to begin.

[`previewInteraction(_:didUpdatePreviewTransition:ended:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteraction(_:didUpdatePreviewTransition:ended:))

Informs the delegate of the progress through the preview phase of the preview interaction.

[`previewInteraction(_:didUpdateCommitTransition:ended:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteraction(_:didUpdateCommitTransition:ended:))

Informs the delegate of the preview interaction’s progress through the commit phase.

[`previewInteractionDidCancel(_:)`](/documentation/UIKit/UIPreviewInteractionDelegate/previewInteractionDidCancel(_:))

Informs the delegate that the specified preview interaction was canceled.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)