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

# selectionDidChange(_:)

Tells the input delegate when the selection has changed in the document.

## Declaration

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

## Parameters

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

## See Also

### Related Documentation

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

### Notifying the delegate of selection changes

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