---
title: selectedTextRange
framework: browserenginekit
role: symbol
role_heading: Instance Property
path: browserenginekit/betextinput/selectedtextrange
---

# selectedTextRange

A range that represents the selected text.

## Declaration

```swift
@NSCopying var selectedTextRange: UITextRange? { get set }
```

## Mentioned in

Integrating custom browser text views with UIKit

## Discussion

Discussion Text might have a selection with a zero length (just the caret) or a range. Editing operations always apply to the selection text. A nil value corresponds to no selection.

## See Also

### Managing selection

- [selectedText](browserenginekit/betextinput/selectedtext.md)
- [isSelectionAtDocumentStart](browserenginekit/betextinput/isselectionatdocumentstart.md)
- [selectPosition(at:completionHandler:)](browserenginekit/betextinput/selectposition(at:completionhandler:).md)
- [selectPosition(at:for:completionHandler:)](browserenginekit/betextinput/selectposition(at:for:completionhandler:).md)
- [adjustSelection(by:completionHandler:)](browserenginekit/betextinput/adjustselection(by:completionhandler:).md)
- [updateCurrentSelection(to:from:in:)](browserenginekit/betextinput/updatecurrentselection(to:from:in:).md)
