---
title: "selectionDidChange(for:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinputdelegate/selectiondidchange(for:)"
---

# selectionDidChange(for:)

Tells the system when the selection has changed in the document.

## Declaration

```swift
func selectionDidChange(for textInput: any BETextInput)
```

## Discussion

Discussion This method results in an document state refresh with an invocation to: -[BETextInput requestTextContextForAutocorrectionWithCompletionHandler:]

## See Also

### Text selection

- [selectionWillChange(for:)](browserenginekit/betextinputdelegate/selectionwillchange(for:).md)
