Instance Method

record(_:toCorrection:forWord:language:inSpellDocumentWithTag:)

Records the user response to the correction indicator being displayed.

Declaration

func record(_ response: NSSpellChecker.CorrectionResponse, toCorrection correction: String, forWord word: String, language: String?, inSpellDocumentWithTag tag: Int)

Parameters

response

The user’s response. The possible values are shown in NSSpellChecker.CorrectionResponse.

correction

The corrected word. This should match the original correction.

word

The original word. This should match the original correction.

language

The language being edited. This should match the original correction.

tag

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.

Discussion

When a correction is automatically proposed, the user may respond in one of several ways. Clients may report this to the spell checker so that it can learn from the user's response and adjust future correction behavior accordingly.

See Also

Automatic Spelling Correction