---
title: "collectionView(_:previewForDismissingContextMenuWithConfiguration:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewdelegate/collectionview(_:previewfordismissingcontextmenuwithconfiguration:)"
---

# collectionView(_:previewForDismissingContextMenuWithConfiguration:)

Returns the destination view when dismissing a context menu.

## Declaration

```swift
optional func collectionView(_ collectionView: UICollectionView, previewForDismissingContextMenuWithConfiguration configuration: UIContextMenuConfiguration) -> UITargetedPreview?
```

## Parameters

- `collectionView`: The collection view object requesting this information.
- `configuration`: The configuration of the menu being displayed.

## Return Value

Return Value A targeted preview object describing the dismissal preview. The interaction animates the presented menu to the preview. Use this method to customize the dismissal animation.

## See Also

### Deprecated

- [collectionView(_:targetIndexPathForMoveFromItemAt:toProposedIndexPath:)](uikit/uicollectionviewdelegate/collectionview(_:targetindexpathformovefromitemat:toproposedindexpath:).md)
- [collectionView(_:contextMenuConfigurationForItemAt:point:)](uikit/uicollectionviewdelegate/collectionview(_:contextmenuconfigurationforitemat:point:).md)
- [collectionView(_:previewForHighlightingContextMenuWithConfiguration:)](uikit/uicollectionviewdelegate/collectionview(_:previewforhighlightingcontextmenuwithconfiguration:).md)
- [collectionView(_:shouldShowMenuForItemAt:)](uikit/uicollectionviewdelegate/collectionview(_:shouldshowmenuforitemat:).md)
- [collectionView(_:canPerformAction:forItemAt:withSender:)](uikit/uicollectionviewdelegate/collectionview(_:canperformaction:foritemat:withsender:).md)
- [collectionView(_:performAction:forItemAt:withSender:)](uikit/uicollectionviewdelegate/collectionview(_:performaction:foritemat:withsender:).md)
