---
title: "textField(_:editMenuForCharactersInRanges:suggestedActions:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextfielddelegate/textfield(_:editmenuforcharactersinranges:suggestedactions:)"
---

# textField(_:editMenuForCharactersInRanges:suggestedActions:)

## Declaration

```swift
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 Value Return a UIMenu describing the desired menu hierarchy. Return @c nil to present the default system menu.

## Discussion

Discussion Asks the delegate for the menu to be shown for the specified ranges.
