requestTextContextForAutocorrection(completionHandler:)
A method the text system calls to get extra information for autocorrection suggestions.
Declaration
func requestTextContextForAutocorrection(completionHandler: @escaping @Sendable (BETextDocumentContext) -> Void)func requestTextContextForAutocorrection() async -> BETextDocumentContextParameters
- completionHandler:
A closure that you call to supply the context as a Betextdocumentcontext.
Mentioned in
Discussion
The system calls this method to retrieve extra context for the currently selected text.
Construct a BETextDocumentContext that contains complete sentences that also include the current selection. If the selection is at a sentence boundary, also include the preceding sentence.