<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextFieldDelegate/textField(_:editMenuForCharactersInRanges:suggestedActions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITextFieldDelegate(im)textField:editMenuForCharactersInRanges:suggestedActions:"
  },
  "title" : "textField(_:editMenuForCharactersInRanges:suggestedActions:)"
}
-->

# textField(_:editMenuForCharactersInRanges:suggestedActions:)

```
optional func textField(_ textField: UITextField, editMenuForCharactersInRanges ranges: [NSValue], suggestedActions: [UIMenuElement]) -> UIMenu?
```

## Parameters

`textField`

The text field requesting the menu.

`ranges`

The text ranges for which the menu is presented for.

`suggestedActions`

The actions and commands that the system suggests.

## Return Value

Return a UIMenu describing the desired menu hierarchy. Return @c nil to present the default system menu.

## Discussion\abstract Asks the delegate for the menu to be shown for the specified `ranges`.

---

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)