---
title: selectedRanges
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstextfinderclient/selectedranges
---

# selectedRanges

Returns an array of selected ranges.

## Declaration

```swift
optional var selectedRanges: [NSValue] { get set }
```

## Discussion

Discussion This property is required for the replace all in selection, select all, and select all in selection actions. The returned NSArray object should contain NSRanges wrapped by NSValues.

## See Also

### Selection Information

- [isSelectable](appkit/nstextfinderclient/isselectable.md)
- [allowsMultipleSelection](appkit/nstextfinderclient/allowsmultipleselection.md)
- [firstSelectedRange](appkit/nstextfinderclient/firstselectedrange.md)
