<!--
{
  "availability" : [
    "macOS: 10.12.2 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextViewDelegate/textView(_:shouldSelectCandidateAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextViewDelegate(im)textView:shouldSelectCandidateAtIndex:"
  },
  "title" : "textView(_:shouldSelectCandidateAt:)"
}
-->

# textView(_:shouldSelectCandidateAt:)

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

```
@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

Returns <doc://com.apple.documentation/documentation/Swift/true> if the framework selects the text.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)