Instance Method


Initiates a search of a range of a string for a misspelled word.


func rangeOfMisspelledWord(in stringToCheck: String, range: NSRange, startingAt startingOffset: Int, wrap wrapFlag: Bool, language: String) -> NSRange



The string to check for misspelled words.


The range of stringToCheck to check for a misspelled word.


The offset within range of stringToCheck to begin checking for misspelled words.


true to continue checking from the beginning of range if no misspelled word is found between startingOffset and the end of range. Specify false to have spell-checking end at the end of range.


The language of the of words to be checked for correct spelling. This string is a ISO 639-1 language code or a combined ISO 639-1 language code and ISO 3166-1 regional code (for example, fr_FR).

Return Value

The range of the first misspelled word encountered or {NSNotFound, 0} if none is found.


To search an entire string or a range within that string, call this method in a loop, resetting startingOffset from each returned range, until you reach the end of the string or specified range within the string.