<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSText/checkSpelling(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSText(im)checkSpelling:"
  },
  "title" : "checkSpelling(_:)"
}
-->

# checkSpelling(_:)

This action method searches for a misspelled word in the receiver’s text.

```
func checkSpelling(_ sender: Any?)
```

## Discussion

The search starts at the end of the selection and continues until it reaches a word suspected of being misspelled or the end of the text. If a word isn’t recognized by the spelling server, a [`showGuessPanel(_:)`](/documentation/AppKit/NSText/showGuessPanel(_:)) message then opens the Guess panel and allows the user to make a correction or add the word to the local dictionary.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)