<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextItem/MenuConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITextItemMenuConfiguration"
  },
  "title" : "UITextItem.MenuConfiguration"
}
-->

# UITextItem.MenuConfiguration

An object that describes what type of menu and preview to show for a text item.

```
@MainActor class MenuConfiguration
```

## Overview

Create and return a menu configuration for a text item in [`textView(_:menuConfigurationFor:defaultMenu:)`](/documentation/UIKit/UITextViewDelegate/textView(_:menuConfigurationFor:defaultMenu:)) to provide a custom menu that the system shows when someone interacts with the text item. Provide a custom view for the item’s preview, or specify that the system displays a default preview.

## Topics

### Creating a menu configuration

[`convenience init(preview: UITextItem.MenuConfiguration.Preview?, menu: UIMenu)`](/documentation/UIKit/UITextItem/MenuConfiguration/init(preview:menu:))

Creates a text item menu configuration with the specified menu and preview.

[`enum Preview`](/documentation/UIKit/UITextItem/MenuConfiguration/Preview)

Constants that indicate what type of preview to display alongside the text item’s menu.

[`+ (instancetype) configurationWithMenu:(UIMenu *) menu;`](/documentation/UIKit/UITextItemMenuConfiguration/configurationWithMenu:)

Creates a menu configuration with the specified menu and a default preview.

[`+ (instancetype) configurationWithPreview:(UITextItemMenuPreview *) preview menu:(UIMenu *) menu;`](/documentation/UIKit/UITextItemMenuConfiguration/configurationWithPreview:menu:)

Creates a menu configuration with the specified menu and custom preview.

[`@interface UITextItemMenuPreview : NSObject`](/documentation/UIKit/UITextItemMenuPreview)

An object representing the preview for a text item.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)