Contents

textField(_:textView:candidatesForSelectedRange:)

Provides a customized list of candidates to the text view’s candidateListTouchBarItem. This method returns an array of objects that represent the elements of a selection.

Declaration

@MainActor optional func textField(_ textField: NSTextField, textView: NSTextView, candidatesForSelectedRange selectedRange: NSRange) -> [Any]?

Discussion

Invoked from updateCandidates. NSTextView uses the candidates returned from this method and suppress its built-in candidate generation. Returning nil from this delegate method allows NSTextView to query candidates from NSSpellChecker.

See Also

Controlling Editing Behavior