Contents

spellServer(_:findMisspelledWordIn:language:wordCount:countOnly:)

Asks the delegate to search for a misspelled word in a given string, using the specified language, and marking the first misspelled word found by returning its range within the string.

Declaration

optional func spellServer(_ sender: NSSpellServer, findMisspelledWordIn stringToCheck: String, language: String, wordCount: UnsafeMutablePointer<Int>, countOnly: Bool) -> NSRange

Parameters

  • sender:

    The NSSpellServer object that sent this message.

  • stringToCheck:

    The string to search for the misspelled word.

  • language:

    The language to use for the search.

  • wordCount:

    On output, returns by reference the number of words from the beginning of the string object until the misspelled word (or the end of string).

  • countOnly:

    If True, the method only counts the words in the string object and does not spell checking.

Return Value

The range of the misspelled word within the given string.

Discussion

Send isWord(inUserDictionaries:caseSensitive:) to the spelling server to determine if the word exists in the user’s language dictionaries.

See Also

Check Grammar and Spelling in Strings