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

# selectionWillChange(for:)

Tells the system when the selection is about to change in the document.

## Declaration

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

## See Also

### Text selection

- [selectionDidChange(for:)](browserenginekit/betextinputdelegate/selectiondidchange(for:).md)
