<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIEditMenuInteractionDelegate/editMenuInteraction(_:menuFor:suggestedActions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIEditMenuInteractionDelegate(im)editMenuInteraction:menuForConfiguration:suggestedActions:"
  },
  "title" : "editMenuInteraction(_:menuFor:suggestedActions:)"
}
-->

# editMenuInteraction(_:menuFor:suggestedActions:)

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

```
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 [`UIResponder`](/documentation/UIKit/UIResponder) chain. You should include these actions in the menu you return.

## 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

UIKit calls this method when the interaction begins or requires an update to the menu’s actions when calling [`reloadVisibleMenu()`](/documentation/UIKit/UIEditMenuInteraction/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.

```swift
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)
    }
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)