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

# checkTextInDocument(_:)

Performs the default text checking on the entire document.

## Declaration

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

## Parameters

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

## Discussion

Discussion Immediately performs the text checking and replaces the document content with the checked content. The checks performed are specified by enabledTextCheckingTypes;

## See Also

### Checking and substituting text

- [checkTextInSelection(_:)](appkit/nstextview/checktextinselection(_:).md)
- [checkText(in:types:options:)](appkit/nstextview/checktext(in:types:options:).md)
- [handleTextCheckingResults(_:forRange:types:options:orthography:wordCount:)](appkit/nstextview/handletextcheckingresults(_:forrange:types:options:orthography:wordcount:).md)
- [enabledTextCheckingTypes](appkit/nstextview/enabledtextcheckingtypes.md)
- [isAutomaticDashSubstitutionEnabled](appkit/nstextview/isautomaticdashsubstitutionenabled.md)
- [toggleAutomaticDashSubstitution(_:)](appkit/nstextview/toggleautomaticdashsubstitution(_:).md)
- [isAutomaticDataDetectionEnabled](appkit/nstextview/isautomaticdatadetectionenabled.md)
- [toggleAutomaticDataDetection(_:)](appkit/nstextview/toggleautomaticdatadetection(_:).md)
- [isAutomaticSpellingCorrectionEnabled](appkit/nstextview/isautomaticspellingcorrectionenabled.md)
- [toggleAutomaticSpellingCorrection(_:)](appkit/nstextview/toggleautomaticspellingcorrection(_:).md)
- [isAutomaticTextReplacementEnabled](appkit/nstextview/isautomatictextreplacementenabled.md)
- [toggleAutomaticTextReplacement(_:)](appkit/nstextview/toggleautomatictextreplacement(_:).md)
- [performValidatedReplacement(in:with:)](appkit/nstextview/performvalidatedreplacement(in:with:).md)
