---
title: UIPreviewInteraction
framework: uikit
role: symbol
role_heading: Class
path: uikit/uipreviewinteraction
---

# UIPreviewInteraction

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

## Declaration

```swift
@MainActor class UIPreviewInteraction
```

## Overview

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.

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 registerForPreviewing(with:sourceView:) and unregisterForPreviewing(withContext:) methods on UIViewController instead of 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: Create a UIPreviewInteraction object, passing the view into the default initializer. Create a delegate object that conforms to the UIPreviewInteractionDelegate protocol, and implement the appropriate methods. Assign the delegate object to the delegate property on the preview interaction object. For more information about the state transitions through which a preview interaction progresses, see UIPreviewInteractionDelegate.

## Topics

### Creating a preview interaction

- [init(view:)](uikit/uipreviewinteraction/init(view:).md)

### Preparing preview interactions

- [delegate](uikit/uipreviewinteraction/delegate.md)
- [UIPreviewInteractionDelegate](uikit/uipreviewinteractiondelegate.md)

### Handling preview interactions

- [view](uikit/uipreviewinteraction/view.md)
- [cancel()](uikit/uipreviewinteraction/cancel().md)
- [location(in:)](uikit/uipreviewinteraction/location(in:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### 3D Touch interactions

- [UIPreviewInteractionDelegate](uikit/uipreviewinteractiondelegate.md)
- [UIPreviewActionItem](uikit/uipreviewactionitem.md)
