---
title: "showCorrectionIndicator(of:primaryString:alternativeStrings:forStringIn:view:completionHandler:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsspellchecker/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.

## Declaration

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

```swift
func showCorrectionIndicator(of type: NSSpellChecker.CorrectionIndicatorType, primaryString: String, alternativeStrings: [String], forStringIn rectOfTypedString: NSRect, view: NSView) async -> String?
```

## Parameters

- `type`: The correction type to display. See doc://com.apple.appkit/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:

## Discussion

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:) method. note: In order to record responses properly (for use with the 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.

## See Also

### Automatic Spelling Correction

- [correction(forWordRange:in:language:inSpellDocumentWithTag:)](appkit/nsspellchecker/correction(forwordrange:in:language:inspelldocumentwithtag:).md)
- [record(_:toCorrection:forWord:language:inSpellDocumentWithTag:)](appkit/nsspellchecker/record(_:tocorrection:forword:language:inspelldocumentwithtag:).md)
- [dismissCorrectionIndicator(for:)](appkit/nsspellchecker/dismisscorrectionindicator(for:).md)
- [NSSpellChecker.CorrectionIndicatorType](appkit/nsspellchecker/correctionindicatortype.md)
- [NSSpellChecker.CorrectionResponse](appkit/nsspellchecker/correctionresponse.md)
