<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPreviewInteraction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPreviewInteraction"
  },
  "title" : "UIPreviewInteraction"
}
-->

# UIPreviewInteraction

A class that registers a view to provide a custom user experience in response to 3D Touch interactions.

```
@MainActor class UIPreviewInteraction
```

## Overview

A 3D Touch interaction results in a *preview interaction* that comprises two phases, the first also called *preview*, followed by *commit*. The interaction progresses through these phases as a person applies more force with a touch. The following image shows the relationship between the force of a person’s touch and the phases of the preview interaction.

![An illustration showing the preview interaction as it progresses through the preview phase and into the commit phases in response to increasing touch force.](images/com.apple.uikit/media-2793214@2x.png)

When using view controller previewing, *peek* represents the preview phase, and *pop* the commit phase.

> Note:
> If you want to provide the system default view controller previewing behavior (*peek* and *pop*), use the ``doc://com.apple.uikit/documentation/UIKit/UIViewController/registerForPreviewing(with:sourceView:)`` and ``doc://com.apple.uikit/documentation/UIKit/UIViewController/unregisterForPreviewing(withContext:)`` methods on ``doc://com.apple.uikit/documentation/UIKit/UIViewController`` instead of ``doc://com.apple.uikit/documentation/UIKit/UIPreviewInteraction``. See `Working With 3D Touch Previews and Preview Quick Actions` for further details.

A preview interaction is responsible for managing 3D Touch interactions for a specified view. It uses a delegate object to communicate the progress and status of the interaction to your code.

To use a preview interaction in your app:

1. Create a [`UIPreviewInteraction`](/documentation/UIKit/UIPreviewInteraction) object, passing the view into the default initializer.
2. Create a delegate object that conforms to the [`UIPreviewInteractionDelegate`](/documentation/UIKit/UIPreviewInteractionDelegate) protocol, and implement the appropriate methods.
3. Assign the delegate object to the [`delegate`](/documentation/UIKit/UIPreviewInteraction/delegate) property on the preview interaction object.

For more information about the state transitions through which a preview interaction progresses, see [`UIPreviewInteractionDelegate`](/documentation/UIKit/UIPreviewInteractionDelegate).

## Topics

### Creating a preview interaction

[`init(view:)`](/documentation/UIKit/UIPreviewInteraction/init(view:))

Returns a newly initialized preview interaction for the specified view.

### Preparing preview interactions

[`delegate`](/documentation/UIKit/UIPreviewInteraction/delegate)

An object that acts as the delegate of the preview interaction.

[`UIPreviewInteractionDelegate`](/documentation/UIKit/UIPreviewInteractionDelegate)

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

### Handling preview interactions

[`view`](/documentation/UIKit/UIPreviewInteraction/view)

The view from which the preview interaction receives touch events.

[`cancel()`](/documentation/UIKit/UIPreviewInteraction/cancel())

Cancels the current preview interaction.

[`location(in:)`](/documentation/UIKit/UIPreviewInteraction/location(in:))

Returns the location of the touch that started the interaction.



---

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)