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

# UITargetedPreview

An object describing the view to use during preview-related animations.

```
@MainActor class UITargetedPreview
```

## Overview

Use a [`UITargetedPreview`](/documentation/UIKit/UITargetedPreview) to specify the view to use during an animated transition.

## Topics

### Creating a targeted preview object

[Adding context menus in your app](/documentation/UIKit/adding-context-menus-in-your-app)

Provide quick access to useful actions by adding context menus to your iOS app.

[`init(view:parameters:target:)`](/documentation/UIKit/UITargetedPreview/init(view:parameters:target:))

Creates a targeted preview with the specified view, parameters, and target container.

[`init(view:parameters:)`](/documentation/UIKit/UITargetedPreview/init(view:parameters:))

Creates a targeted preview for a view in the current window and including the specified parameters.

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

Creates a targeted preview for a view in the current window.

### Getting the preview attributes

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

The view that’s the target of the animation.

[`target`](/documentation/UIKit/UITargetedPreview/target)

The container for the target view.

[`size`](/documentation/UIKit/UITargetedPreview/size)

The size of the view.

[`parameters`](/documentation/UIKit/UITargetedPreview/parameters)

Additional parameters to use when configuring the animations.

### Changing the target’s container

[`retargetedPreview(with:)`](/documentation/UIKit/UITargetedPreview/retargetedPreview(with:))

Returns a targeted preview object with the same view and parameters, but with a different target container.



---

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)