<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextView/checkText(in:types:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextView(im)checkTextInRange:types:options:"
  },
  "title" : "checkText(in:types:options:)"
}
-->

# checkText(in:types:options:)

Check and replace the text in the range using the specified checking types and options.

```
func checkText(in range: NSRange, types checkingTypes: NSTextCheckingTypes, options: [NSSpellChecker.OptionKey : Any] = [:])
```

## Parameters

`range`

The range to check.

`checkingTypes`

The type of checking to be performed, passed by-reference. The possible constants are listed in <doc://com.apple.documentation/documentation/Foundation/NSTextCheckingTypes> and can be combined using the C bit-wise `OR` operator to perform multiple checks at the same time.

`options`

A dictionary of values used during the checking process to perform. See Spell Checking Option Dictionary Keys for the supported values.

## Discussion

This method calls the delegate method [`textView(_:willCheckTextIn:options:types:)`](/documentation/AppKit/NSTextViewDelegate/textView(_:willCheckTextIn:options:types:)) allowing you to modify the parameters before the checking occurs.

This method usually would not be called directly, since `NSTextView` itself will call it as needed, but it can be overridden.

---

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)