---
title: "toggleGrammarChecking(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextview/togglegrammarchecking(_:)"
---

# toggleGrammarChecking(_:)

Changes the state of grammar checking from enabled to disabled and vice versa.

## Declaration

```swift
func toggleGrammarChecking(_ sender: Any?)
```

## Parameters

- `sender`: The control sending the message; may be nil.

## See Also

### Working with the spelling checker

- [isContinuousSpellCheckingEnabled](appkit/nstextview/iscontinuousspellcheckingenabled.md)
- [spellCheckerDocumentTag](appkit/nstextview/spellcheckerdocumenttag.md)
- [toggleContinuousSpellChecking(_:)](appkit/nstextview/togglecontinuousspellchecking(_:).md)
- [isGrammarCheckingEnabled](appkit/nstextview/isgrammarcheckingenabled.md)
- [setSpellingState(_:range:)](appkit/nstextview/setspellingstate(_:range:).md)
