---
title: "rects(forCharacterRange:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextfinderclient/rects(forcharacterrange:)"
---

# rects(forCharacterRange:)

An array containing the located text in the content view’s coordinate system.

## Declaration

```swift
optional func rects(forCharacterRange range: NSRange) -> [NSValue]?
```

## Parameters

- `range`: The range of the located character string.

## Return Value

Return Value An array containing the rectangles containing the located text in the content view object’s coordinate system and return that array. The rectangles are return wrapped as NSValue objects.

## Discussion

Discussion The text finder uses this method to determine the location to display the find indicator. The given range is guaranteed not to overlap multiple views.

## See Also

### Determining and Displaying Text Locations

- [contentView(at:effectiveCharacterRange:)](appkit/nstextfinderclient/contentview(at:effectivecharacterrange:).md)
- [scrollRangeToVisible(_:)](appkit/nstextfinderclient/scrollrangetovisible(_:).md)
- [visibleCharacterRanges](appkit/nstextfinderclient/visiblecharacterranges.md)
