NSSpellChecker
An interface to the Cocoa spell-checking service.
Declaration
class NSSpellCheckerOverview
To handle all its spell checking, an app needs only one instance of NSSpellChecker, known as the spell checker. Using the spell checker you manage the Spelling panel, in which the user can specify decisions about words that are suspect. The spell checker also offers the ability to provide word completions to augment the text completion system.
Topics
Getting the Spell Checker
Configuring Spell Checkers Languages
Managing Panels
spellingPanelsubstitutionsPanelupdateSpellingPanel(withGrammarString:detail:)updatePanels()accessoryViewsubstitutionsPanelAccessoryViewController
Checking Strings for Spelling and Grammar
countWords(in:language:)checkSpelling(of:startingAt:)checkSpelling(of:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:)checkGrammar(of:startingAt:language:wrap:inSpellDocumentWithTag:details:)check(_:range:types:options:inSpellDocumentWithTag:orthography:wordCount:)requestChecking(of:range:types:options:inSpellDocumentWithTag:completionHandler:)guesses(forWordRange:in:language:inSpellDocumentWithTag:)
Managing the Spell-Checking Process
uniqueSpellDocumentTag()closeSpellDocument(withTag:)ignoreWord(_:inSpellDocumentWithTag:)ignoredWords(inSpellDocumentWithTag:)setIgnoredWords(_:inSpellDocumentWithTag:)setWordFieldStringValue(_:)updateSpellingPanel(withMisspelledWord:)completions(forPartialWordRange:in:language:inSpellDocumentWithTag:)hasLearnedWord(_:)unlearnWord(_:)learnWord(_:)userQuotesArray(forLanguage:)userReplacementsDictionary
Data Detector Interaction
Automatic Spelling Correction
correction(forWordRange:in:language:inSpellDocumentWithTag:)showCorrectionIndicator(of:primaryString:alternativeStrings:forStringIn:view:completionHandler:)record(_:toCorrection:forWord:language:inSpellDocumentWithTag:)dismissCorrectionIndicator(for:)NSSpellChecker.CorrectionIndicatorTypeNSSpellChecker.CorrectionResponse
Notifications
Type Properties
didChangeAutomaticCapitalizationNotificationdidChangeAutomaticDashSubstitutionNotificationdidChangeAutomaticPeriodSubstitutionNotificationdidChangeAutomaticQuoteSubstitutionNotificationdidChangeAutomaticTextCompletionNotificationisAutomaticCapitalizationEnabledisAutomaticDashSubstitutionEnabledisAutomaticInlinePredictionEnabledisAutomaticPeriodSubstitutionEnabledisAutomaticQuoteSubstitutionEnabledisAutomaticSpellingCorrectionEnabledisAutomaticTextCompletionEnabledisAutomaticTextReplacementEnabled