---
title: "selectText(in:at:completionHandler:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinput/selecttext(in:at:completionhandler:)"
---

# selectText(in:at:completionHandler:)

Selects the text within the given granularity at the given point in the text view.

## Declaration

```swift
func selectText(in granularity: UITextGranularity, at point: CGPoint, completionHandler: @escaping @Sendable () -> Void)
```

```swift
func selectText(in granularity: UITextGranularity, at point: CGPoint) async
```

## Parameters

- `granularity`: The amount of text to select.
- `point`: The location of the selection in the text view.
- `completionHandler`: A block you call after your text view handles the gesture.

## Mentioned in

Integrating custom browser text views with UIKit
