Instance Method


Requests unified text checking for the given range of the given string.


func check(_ stringToCheck: String, range: NSRange, types checkingTypes: NSTextCheckingTypes, options: [NSSpellChecker.OptionKey : Any]? = nil, inSpellDocumentWithTag tag: Int, orthography: AutoreleasingUnsafeMutablePointer<NSOrthography?>?, wordCount: UnsafeMutablePointer<Int>?) -> [NSTextCheckingResult]



The string to check.


The range of the string to check.


The type of checking to be performed. The possible constants are listed in NSTextCheckingResult.CheckingType and can be combined using the C bit-wise OR operator to perform multiple checks at the same time.


The options dictionary specifying the types of checking to perform. See Spell Checking Option Dictionary Keys for the possible keys and expected values.


An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.


Returns by-reference, the orthography of the range of the string. See NSOrthography for more information.


Returns by-reference, the word count for the range of the string.

Return Value

An array of NSTextCheckingResult objects describing particular items found during checking and their individual ranges, sorted by range origin, then range end, then result type.