---
title: "init(delegate:)"
framework: uikit
role: symbol
role_heading: Initializer
path: "uikit/uicontextmenuinteraction/init(delegate:)"
---

# init(delegate:)

Creates a context menu interaction object with the specified delegate object.

## Declaration

```swift
init(delegate: any UIContextMenuInteractionDelegate)
```

## Parameters

- `delegate`: The object that provides the contextual menu and responds to other interaction-related events. This object must adopt the doc://com.apple.uikit/documentation/UIKit/UIContextMenuInteractionDelegate protocol.

## Return Value

Return Value A new context menu interaction object with the associated delegate.

## See Also

### Creating a context menu interaction object

- [Adding context menus in your app](uikit/adding-context-menus-in-your-app.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)
