---
title: "contextMenuInteraction(_:willPerformPreviewActionForMenuWith:animator:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:willperformpreviewactionformenuwith:animator:)"
---

# contextMenuInteraction(_:willPerformPreviewActionForMenuWith:animator:)

Informs the delegate when a preview action begins.

## Declaration

```swift
optional func contextMenuInteraction(_ interaction: UIContextMenuInteraction, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: any UIContextMenuInteractionCommitAnimating)
```

## Parameters

- `interaction`: The interaction object that triggered the interaction.
- `configuration`: The context menu configuration.
- `animator`: The animator to configure custom animations.

## See Also

### Responding to the menu’s appearance

- [UIContextMenuInteractionCommitAnimating](uikit/uicontextmenuinteractioncommitanimating.md)
