---
title: firstSelectedRange
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstextfinderclient/firstselectedrange
---

# firstSelectedRange

Returns the currently selected range.

## Declaration

```swift
optional var firstSelectedRange: NSRange { get }
```

## Discussion

Discussion This property is required for the next match, previous match, replace, replace and find and set search string actions. The client should return its first selected range, or {index, 0} to indicate the location of the insertion point if there is no selection.

## See Also

### Selection Information

- [isSelectable](appkit/nstextfinderclient/isselectable.md)
- [allowsMultipleSelection](appkit/nstextfinderclient/allowsmultipleselection.md)
- [selectedRanges](appkit/nstextfinderclient/selectedranges.md)
