<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextViewDelegate/textView(_:menuConfigurationFor:defaultMenu:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextViewDelegate(im)textView:menuConfigurationForTextItem:defaultMenu:"
  },
  "title" : "textView(_:menuConfigurationFor:defaultMenu:)"
}
-->

# textView(_:menuConfigurationFor:defaultMenu:)

Asks the delegate for the menu configuration to be performed when interacting with a text item.

```
optional func textView(_ textView: UITextView, menuConfigurationFor textItem: UITextItem, defaultMenu: UIMenu) -> UITextItem.MenuConfiguration?
```

## Parameters

`textView`

The text view requesting the menu.

`textItem`

The text item for performing said action.

`defaultMenu`

The default menu for the specified text item.

## Return Value

Return a menu configuration to be presented when the text item is interacted with. Return @c nil to prevent the menu from being presented.

---

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)