---
title: "contextMenuInteraction(_:previewForDismissingMenuWithConfiguration:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:previewfordismissingmenuwithconfiguration:)"
---

# contextMenuInteraction(_:previewForDismissingMenuWithConfiguration:)

Returns the destination view to use when animating the appearance of the preview interface.

## Declaration

```swift
optional func contextMenuInteraction(_ interaction: UIContextMenuInteraction, previewForDismissingMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview?
```

## Parameters

- `interaction`: The interaction object that triggered the preview.
- `configuration`: The configuration object associated with the current interaction.

## Return Value

Return Value An object containing the destination view and configuration parameters for the animation.

## Discussion

Discussion When the user dismisses the preview interface, UIKit animates that interface to the view you specify in the returned UITargetedPreview object.

## See Also

### Deprecated

- [contextMenuInteraction(_:previewForHighlightingMenuWithConfiguration:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:previewforhighlightingmenuwithconfiguration:).md)
