---
title: selectedRange
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uitextview/selectedrange
---

# selectedRange

The current selection range of the text view.

## Declaration

```swift
var selectedRange: NSRange { get set }
```

## Discussion

Discussion In iOS 2.2 and earlier, the length of the selection range is always 0, indicating that the selection is actually an insertion point. In iOS 3.0 and later, the length of the selection range may be non-zero.

## See Also

### Working with the selection

- [scrollRangeToVisible(_:)](uikit/uitextview/scrollrangetovisible(_:).md)
- [clearsOnInsertion](uikit/uitextview/clearsoninsertion.md)
- [isSelectable](uikit/uitextview/isselectable.md)
