---
title: "textWillChange(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextinputdelegate/textwillchange(_:)"
---

# textWillChange(_:)

Tells the input delegate when text is about to change in the document.

## Declaration

```swift
func textWillChange(_ textInput: (any UITextInput)?)
```

## Parameters

- `textInput`: The document instance whose class adopts the UITextInput protocol.

## Mentioned in

Configuring a custom keyboard interface

## See Also

### Related Documentation

- [selectionWillChange(_:)](uikit/uitextinputdelegate/selectionwillchange(_:).md)

### Notifying the delegate of textual changes

- [textDidChange(_:)](uikit/uitextinputdelegate/textdidchange(_:).md)
