---
title: "addTextRect(_:forCharacterRange:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/betextdocumentcontext/addtextrect(_:forcharacterrange:)"
---

# addTextRect(_:forCharacterRange:)

Adds a rectangle that corresponds to the specified character range in the document.

## Declaration

```swift
func addTextRect(_ rect: CGRect, forCharacterRange range: NSRange)
```

## Discussion

Discussion Specify the rectangle in the view coordinates of textInputView.
