---
title: candidateRects
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstextpreview/candidaterects
---

# candidateRects

Rectangles that define the specific portions of text to highlight.

## Declaration

```swift
var candidateRects: [NSValue] { get }
```

## Discussion

Discussion At initialization time, you set this property to an array of NSValue objects, each of which contains an NSRect in the coordinate space of the target view. Each rectangle contains a bounding rectangle for text that is part of the preview. When applying visual effects, the system adds highlights only to the text in the specified rectangles.

## See Also

### Getting the preview details

- [previewImage](appkit/nstextpreview/previewimage.md)
- [presentationFrame](appkit/nstextpreview/presentationframe.md)
