---
title: textRanges
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/nstextselection/textranges
---

# textRanges

Represents an array of noncontiguous logical ranges in the selection.

## Declaration

```swift
var textRanges: [NSTextRange] { get }
```

## Discussion

Discussion The array must be logically ordered. When editing, all ranges in a text selection constitute a single insertion point.

## See Also

### Characteristics of a selection

- [affinity](uikit/nstextselection/affinity-swift.property.md)
- [NSTextSelection.Affinity](uikit/nstextselection/affinity-swift.enum.md)
- [anchorPositionOffset](uikit/nstextselection/anchorpositionoffset.md)
- [granularity](uikit/nstextselection/granularity-swift.property.md)
- [NSTextSelection.Granularity](uikit/nstextselection/granularity-swift.enum.md)
- [isLogical](uikit/nstextselection/islogical.md)
- [isTransient](uikit/nstextselection/istransient.md)
- [secondarySelectionLocation](uikit/nstextselection/secondaryselectionlocation.md)
- [NSTextLocation](uikit/nstextlocation.md)
- [typingAttributes](uikit/nstextselection/typingattributes.md)
