---
title: "textView(_:shouldSelectCandidateAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextviewdelegate/textview(_:shouldselectcandidateat:)"
---

# textView(_:shouldSelectCandidateAt:)

Returns a Boolean value that indicates whether to select the text object at the index.

## Declaration

```swift
@MainActor optional func textView(_ textView: NSTextView, shouldSelectCandidateAt index: Int) -> Bool
```

## Parameters

- `textView`: The text view that sent the message.
- `index`: The index that represents the start of the candidate text to evaluate.

## Return Value

Return Value Returns true if the framework selects the text.

## See Also

### Managing the Selection

- [textView(_:willChangeSelectionFromCharacterRange:toCharacterRange:)](appkit/nstextviewdelegate/textview(_:willchangeselectionfromcharacterrange:tocharacterrange:).md)
- [textView(_:willChangeSelectionFromCharacterRanges:toCharacterRanges:)](appkit/nstextviewdelegate/textview(_:willchangeselectionfromcharacterranges:tocharacterranges:).md)
- [textViewDidChangeSelection(_:)](appkit/nstextviewdelegate/textviewdidchangeselection(_:).md)
- [textView(_:candidates:forSelectedRange:)](appkit/nstextviewdelegate/textview(_:candidates:forselectedrange:).md)
- [textView(_:candidatesForSelectedRange:)](appkit/nstextviewdelegate/textview(_:candidatesforselectedrange:).md)
- [textView(_:shouldUpdateTouchBarItemIdentifiers:)](appkit/nstextviewdelegate/textview(_:shouldupdatetouchbaritemidentifiers:).md)
