<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/BETextInput/setSelection(from:to:gesture:state:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "c:objc(pl)BETextInput(im)setSelectionFromPoint:toPoint:gesture:state:"
  },
  "title" : "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.

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)