---
title: "setSelection(from:to:gesture:state:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinput/setselection(from:to:gesture:state:)"
---

# setSelection(from:to:gesture:state:)

Notifies the text view that its selection needs to change to the text between the given points.

## Declaration

```swift
func setSelection(from: CGPoint, to: CGPoint, gesture: BEGestureType, state: UIGestureRecognizer.State)
```

## Parameters

- `from`: The start of the selected region.
- `to`: The end of the selected region.
- `gesture`: The gesture that changes the selection.
- `state`: The state of the gesture.

## Mentioned in

Integrating custom browser text views with UIKit
