<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSpellChecker/showCorrectionIndicator(of:primaryString:alternativeStrings:forStringIn:view:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSpellChecker(im)showCorrectionIndicatorOfType:primaryString:alternativeStrings:forStringInRect:view:completionHandler:"
  },
  "title" : "showCorrectionIndicator(of:primaryString:alternativeStrings:forStringIn:view:completionHandler:)"
}
-->

# showCorrectionIndicator(of:primaryString:alternativeStrings:forStringIn:view:completionHandler:)

Display a suitable user interface to indicate a correction may need to be made.

```
func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView, completionHandler completionBlock: (@Sendable (String?) -> Void)? = nil)
```

## Parameters

`type`

The correction type to display. See [`NSSpellChecker.CorrectionIndicatorType`](/documentation/AppKit/NSSpellChecker/CorrectionIndicatorType) for possible values.

`primaryString`

The first string to be displayed, a correction or reversion according to the `type` of indicator.

`alternativeStrings`

An array of alternative strings to insert. This array may be empty.

`rectOfTypedString`

The rectangle of the typed text.

`view`

The view in which the correction indicator is to be displayed.

`completionBlock`

The Block called when a the correction indicator is dismissed.

    The Block takes one argument:

- acceptedString: The correction string the user excepted. If the user does not select a correction string nil is returned.

## Discussion

Only one indicator at a time may be displayed for a given view, and the only thing a client may do with the indicator after displaying it is to dismiss it using the [`dismissCorrectionIndicator(for:)`](/documentation/AppKit/NSSpellChecker/dismissCorrectionIndicator(for:)) method.

> Note:
> In order to record responses properly (for use with the ``doc://com.apple.appkit/documentation/AppKit/NSSpellChecker/record(_:toCorrection:forWord:language:inSpellDocumentWithTag:)`` method), clients must store the original word and original correction at least from the point at which the user accepts it until the user edits or reverts it.

---

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)