<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIContextMenuActionProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@T@UIContextMenuActionProvider"
  },
  "title" : "UIContextMenuActionProvider"
}
-->

# UIContextMenuActionProvider

Returns an action-based contextual menu, optionally incorporating the system-suggested actions.

```
typealias UIContextMenuActionProvider = ([UIMenuElement]) -> UIMenu?
```

## Parameters

`suggestedActions`

Suggested actions for you to include in your menu. UIKit collects these actions from responders in the current responder chain. You are not required to include the actions in your menu.

## Return Value

The menu object containing the actions for the user to select.

## Discussion

Use this handler to create [`UIAction`](/documentation/UIKit/UIAction) objects representing the actions the user may choose from your menu. To organize groups of actions hierarchically, create a [`UIMenu`](/documentation/UIKit/UIMenu) object to represent a submenu and add nested actions to it. Finally, build your top-level [`UIMenu`](/documentation/UIKit/UIMenu) object from the actions and submenus you created, and return that menu object from your handler.

---

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)