---
title: "editMenuInteraction(_:menuFor:suggestedActions:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uieditmenuinteractiondelegate/editmenuinteraction(_:menufor:suggestedactions:)"
---

# editMenuInteraction(_:menuFor:suggestedActions:)

Provides the menu to use when the interaction begins or requires an update.

## Declaration

```swift
optional func editMenuInteraction(_ interaction: UIEditMenuInteraction, menuFor configuration: UIEditMenuConfiguration, suggestedActions: [UIMenuElement]) -> UIMenu?
```

## Parameters

- `interaction`: The interaction object triggering the menu.
- `configuration`: The object containing the configuration details for the menu.
- `suggestedActions`: The array of suggested actions UIKit gathers from the doc://com.apple.uikit/documentation/UIKit/UIResponder chain. You should include these actions in the menu you return.

## Return Value

Return Value Returns a menu describing the desired menu hierarchy. To present the default system menu, return nil. To avoid presenting a menu, return an empty menu.

## Discussion

Discussion UIKit calls this method when the interaction begins or requires an update to the menu’s actions when calling reloadVisibleMenu(). The interaction displays the menu you provide. When not implemented, the default behavior is the same as returning a menu including the suggestedActions. The following example returns a menu with an additional actions in a submenu. func editMenuInteraction(_ interaction: UIEditMenuInteraction, menuFor configuration: UIEditMenuConfiguration, suggestedActions: [UIMenuElement]) -> UIMenu {         let indentationMenu = UIMenu(title: "Indentation", image: UIImage(systemName: "list.bullet.indent"), children: [             UIAction(title: "Increase", image: UIImage(systemName: "increase.indent")) { (action) in                 // Increase indentation action.                 print("increase indent")             },             UIAction(title: "Decrease", image: UIImage(systemName: "decrease.indent")) { (action) in                 // Decrease indentation action.                 print("decrease indent")             }         ])

var actions = suggestedActions         actions.append(indentationMenu)         return UIMenu(children: actions)     }

## See Also

### Customizing the Menu

- [editMenuInteraction(_:targetRectFor:)](uikit/uieditmenuinteractiondelegate/editmenuinteraction(_:targetrectfor:).md)
- [editMenuInteraction(_:willPresentMenuFor:animator:)](uikit/uieditmenuinteractiondelegate/editmenuinteraction(_:willpresentmenufor:animator:).md)
- [editMenuInteraction(_:willDismissMenuFor:animator:)](uikit/uieditmenuinteractiondelegate/editmenuinteraction(_:willdismissmenufor:animator:).md)
- [UIEditMenuInteractionAnimating](uikit/uieditmenuinteractionanimating.md)
