---
title: UIContextMenuConfiguration
framework: uikit
role: symbol
role_heading: Class
path: uikit/uicontextmenuconfiguration
---

# UIContextMenuConfiguration

An object containing the configuration details for the contextual menu.

## Declaration

```swift
@MainActor class UIContextMenuConfiguration
```

## Overview

Overview Before displaying a contextual menu, the system asks your UIContextMenuInteractionDelegate to provide a UIContextMenuConfiguration object with details about that menu. In your contextMenuInteraction(_:configurationForMenuAtLocation:) method, use the location parameter to determine where the interaction occurred, and use the content at that location to configure your contextual menu and view controller. Provide custom blocks to generate: The contextual menu with the actions for your content. An optional view controller to use when displaying your content. If you specify a default object without any custom handler blocks, the system displays a default preview interface with no menu.

## Topics

### Creating the menu configuration object

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

### Getting the configuration identifier

- [identifier](uikit/uicontextmenuconfiguration/identifier.md)

### Handling multiple-item interactions

- [secondaryItemIdentifiers](uikit/uicontextmenuconfiguration/secondaryitemidentifiers.md)
- [badgeCount](uikit/uicontextmenuconfiguration/badgecount.md)

### Specifying the order of menu elements

- [preferredMenuElementOrder](uikit/uicontextmenuconfiguration/preferredmenuelementorder.md)
- [UIContextMenuConfiguration.ElementOrder](uikit/uicontextmenuconfiguration/elementorder.md)

### Instance Properties

- [allowsTypeSelect](uikit/uicontextmenuconfiguration/allowstypeselect.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### Providing the preview configuration data

- [contextMenuInteraction(_:configurationForMenuAtLocation:)](uikit/uicontextmenuinteractiondelegate/contextmenuinteraction(_:configurationformenuatlocation:).md)
