---
title: "selectionRects(for:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextinput/selectionrects(for:)"
---

# selectionRects(for:)

Returns an array of selection rectangles corresponding to the given text range.

## Declaration

```swift
func selectionRects(for range: UITextRange) -> [UITextSelectionRect]
```

## Parameters

- `range`: The range of text for which to return selection rectangles.

## Mentioned in

Integrating custom browser text views with UIKit
