---
title: UIContextMenuInteractionDelegate
framework: uikit
role: symbol
role_heading: Protocol
path: uikit/uicontextmenuinteractiondelegate
---

# UIContextMenuInteractionDelegate

The methods for providing the set of actions to perform on your content, and for customizing the preview of that content.

## Declaration

```swift
@MainActor protocol UIContextMenuInteractionDelegate : NSObjectProtocol
```

## Mentioned in

Building a desktop-class iPad app

## Overview

Overview Use this protocol to provide UIKit with the contextual menu that you want to display. When a UIContextMenuInteraction object detects an appropriate interaction, it calls the contextMenuInteraction(_:configurationForMenuAtLocation:) method of your delegate. You use that method to specify the basic configuration details for your interface. In addition to your contextual menu, you can tell UIKit whether you want it to display a default preview interface or a custom view controller that you provide. You can also specify options for how you want UIKit to animate the presentation and dismissal of that interface. For additional information about how to implement contextual menus, see Adding context menus in your app.

## Topics

### Providing the preview configuration data

- [contextMenuInteraction(_:configurationForMenuAtLocation:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:configurationformenuatlocation:).md)
- [UIContextMenuConfiguration](uikit/uicontextmenuconfiguration.md)

### Customizing the preview animations

- [contextMenuInteraction(_:configuration:highlightPreviewForItemWithIdentifier:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:configuration:highlightpreviewforitemwithidentifier:).md)
- [contextMenuInteraction(_:configuration:dismissalPreviewForItemWithIdentifier:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:configuration:dismissalpreviewforitemwithidentifier:).md)
- [Adding menus and shortcuts to the menu bar and user interface](uikit/adding-menus-and-shortcuts-to-the-menu-bar-and-user-interface.md)

### Responding to the menu’s appearance

- [contextMenuInteraction(_:willPerformPreviewActionForMenuWith:animator:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:willperformpreviewactionformenuwith:animator:).md)
- [UIContextMenuInteractionCommitAnimating](uikit/uicontextmenuinteractioncommitanimating.md)

### Handling animations

- [contextMenuInteraction(_:willDisplayMenuFor:animator:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:willdisplaymenufor:animator:).md)
- [contextMenuInteraction(_:willEndFor:animator:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:willendfor:animator:).md)
- [UIContextMenuInteractionAnimating](uikit/uicontextmenuinteractionanimating.md)

### Deprecated

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

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [UIButton](uikit/uibutton.md)
- [UIColorWell](uikit/uicolorwell.md)
- [UIControl](uikit/uicontrol.md)
- [UIDatePicker](uikit/uidatepicker.md)
- [UIPageControl](uikit/uipagecontrol.md)
- [UIPasteControl](uikit/uipastecontrol.md)
- [UIRefreshControl](uikit/uirefreshcontrol.md)
- [UISearchTextField](uikit/uisearchtextfield.md)
- [UISegmentedControl](uikit/uisegmentedcontrol.md)
- [UISlider](uikit/uislider.md)
- [UIStepper](uikit/uistepper.md)
- [UISwitch](uikit/uiswitch.md)
- [UITextField](uikit/uitextfield.md)

## See Also

### Contextual menus

- [UIContextMenuSystem](uikit/uicontextmenusystem.md)
- [UIContextMenuInteraction](uikit/uicontextmenuinteraction.md)
- [UITargetedPreview](uikit/uitargetedpreview.md)
- [UIPreviewTarget](uikit/uipreviewtarget.md)
- [UIPreviewParameters](uikit/uipreviewparameters.md)
