---
title: textRanges
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/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](appkit/nstextselection/affinity-swift.property.md)
- [NSTextSelection.Affinity](appkit/nstextselection/affinity-swift.enum.md)
- [anchorPositionOffset](appkit/nstextselection/anchorpositionoffset.md)
- [granularity](appkit/nstextselection/granularity-swift.property.md)
- [NSTextSelection.Granularity](appkit/nstextselection/granularity-swift.enum.md)
- [isLogical](appkit/nstextselection/islogical.md)
- [isTransient](appkit/nstextselection/istransient.md)
- [secondarySelectionLocation](appkit/nstextselection/secondaryselectionlocation.md)
- [NSTextLocation](appkit/nstextlocation.md)
- [typingAttributes](appkit/nstextselection/typingattributes.md)
