checkText(in:types:options:)
Check and replace the text in the range using the specified checking types and options.
Declaration
func checkText(in range: NSRange, types checkingTypes: NSTextCheckingTypes, options: [NSSpellChecker.OptionKey : Any] = [:])Parameters
- range:
The range to check.
- checkingTypes:
The type of checking to be performed, passed by-reference. The possible constants are listed in Nstextcheckingtypes and can be combined using the C bit-wise
ORoperator to perform multiple checks at the same time. - options:
A dictionary of values used during the checking process to perform. See Spell Checking Option Dictionary Keys for the supported values.
Discussion
This method calls the delegate method textView(_:willCheckTextIn:options:types:) allowing you to modify the parameters before the checking occurs.
This method usually would not be called directly, since NSTextView itself will call it as needed, but it can be overridden.
See Also
Checking and substituting text
checkTextInDocument(_:)checkTextInSelection(_:)handleTextCheckingResults(_:forRange:types:options:orthography:wordCount:)enabledTextCheckingTypesisAutomaticDashSubstitutionEnabledtoggleAutomaticDashSubstitution(_:)isAutomaticDataDetectionEnabledtoggleAutomaticDataDetection(_:)isAutomaticSpellingCorrectionEnabledtoggleAutomaticSpellingCorrection(_:)isAutomaticTextReplacementEnabledtoggleAutomaticTextReplacement(_:)performValidatedReplacement(in:with:)