textView(_:shouldSetSpellingState:range:)
Sent when the spelling state is changed.
Declaration
@MainActor optional func textView(_ textView: NSTextView, shouldSetSpellingState value: Int, range affectedCharRange: NSRange) -> IntParameters
- textView:
The text view sending the message.
- value:
The proposed spelling state value to set. Possible values, for the temporary attribute on the layout manager using the key NSSpellingStateAttributeName, are:
Nsspellingstatespellingflag to highlight spelling issues.
Nsspellingstategrammarflag to highlight grammar issues.
- affectedCharRange:
The character range over which to set the given spelling state.
Return Value
The actual spelling state to set.
Discussion
Delegate only. Allows delegate to control the setting of spelling and grammar indicators.