writingToolsCoordinator(_:requestsGrammarResultsFor:completion:)
Asks the delegate for information about grammar issues in the specified context.
Declaration
optional func writingToolsCoordinator(_ writingToolsCoordinator: NSWritingToolsCoordinator, requestsGrammarResultsFor context: NSWritingToolsCoordinator.Context, completion: @escaping @Sendable ([NSTextCheckingResult]) -> Void)optional func writingToolsCoordinator(_ writingToolsCoordinator: NSWritingToolsCoordinator, grammarResultsFor context: NSWritingToolsCoordinator.Context) async -> [NSTextCheckingResult]Discussion
To support the grammar presentation UI, the delegate should provide information about the identified and currently indicated grammar issues in the specified context. The elements of the results array should be NSTextCheckingResult objects of grammar type, of the sort that are returned from grammar checking, with ranges relative to the context. If you use grammar presentation, you must implement this delegate method to provide them.