<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWritingToolsCoordinator/showGrammarPresentation(for:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWritingToolsCoordinator(im)showGrammarPresentationForRange:inContext:"
  },
  "title" : "showGrammarPresentation(for:in:)"
}
-->

# showGrammarPresentation(for:in:)

Used to support the presentation of grammar issues in text. When
the user interacts with an issue, call this to bring up the relevant UI.

```
func showGrammarPresentation(for range: NSRange, in context: NSWritingToolsCoordinator.Context) -> Bool
```

## Discussion

Pass in context and range to identify the issue the user selected.
The context must match one of the contexts returned from
[`writingToolsCoordinator(_:requestsContextsFor:completion:)`](/documentation/AppKit/NSWritingToolsCoordinator/Delegate-swift.protocol/writingToolsCoordinator(_:requestsContextsFor:completion:))
and the range must match the range in the context of one
of the grammar details returned for that context from
[`writingToolsCoordinator(_:requestsGrammarResultsFor:completion:)`](/documentation/AppKit/NSWritingToolsCoordinator/Delegate-swift.protocol/writingToolsCoordinator(_:requestsGrammarResultsFor:completion:))
Returns NO if the UI cannot be brought up.

---

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)