<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIContextMenuInteractionDelegate/contextMenuInteraction(_:configuration:dismissalPreviewForItemWithIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIContextMenuInteractionDelegate(im)contextMenuInteraction:configuration:dismissalPreviewForItemWithIdentifier:"
  },
  "title" : "contextMenuInteraction(_:configuration:dismissalPreviewForItemWithIdentifier:)"
}
-->

# contextMenuInteraction(_:configuration:dismissalPreviewForItemWithIdentifier:)

Asks the delegate for a preview of the item with the specified identifier when a context-menu interaction ends.

```
optional func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configuration: UIContextMenuConfiguration, dismissalPreviewForItemWithIdentifier identifier: any NSCopying) -> UITargetedPreview?
```

## Parameters

`interaction`

The context-menu interaction object.

`configuration`

The configuration of the menu to dismiss.

`identifier`

The identifier for the item to generate a preview for.

## Return Value

A targeted preview object corresponding to the item with the identifier to use during the menu’s dismissal animation.

## Discussion

The system calls this method when a context-menu dismissal occurs. Implement this method to override the default dismissal preview that the system generates for the item.

---

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)