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

# collectionView(_:previewForHighlightingContextMenuWithConfiguration:)

Returns a view to override the default preview the collection view created.

## Declaration

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

## Parameters

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

## Return Value

Return Value A targeted preview object describing the highlight preview.

## See Also

### Deprecated

- [collectionView(_:targetIndexPathForMoveFromItemAt:toProposedIndexPath:)](uikit/uicollectionviewdelegate/collectionview(_:targetindexpathformovefromitemat:toproposedindexpath:).md)
- [collectionView(_:contextMenuConfigurationForItemAt:point:)](uikit/uicollectionviewdelegate/collectionview(_:contextmenuconfigurationforitemat:point:).md)
- [collectionView(_:previewForDismissingContextMenuWithConfiguration:)](uikit/uicollectionviewdelegate/collectionview(_:previewfordismissingcontextmenuwithconfiguration:).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)
