---
title: UIContextMenuActionProvider
framework: uikit
role: symbol
role_heading: Type Alias
path: uikit/uicontextmenuactionprovider
---

# UIContextMenuActionProvider

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

## Declaration

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

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

## Discussion

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

## See Also

### Creating the menu configuration object

- [init(identifier:previewProvider:actionProvider:)](uikit/uicontextmenuconfiguration/init(identifier:previewprovider:actionprovider:).md)
- [UIContextMenuContentPreviewProvider](uikit/uicontextmenucontentpreviewprovider.md)
