PKStrokeRecognizer
An actor that recognizes handwriting and searches for text within a PencilKit drawing.
Declaration
final actor PKStrokeRecognizerMentioned in
Overview
Use PKStrokeRecognizer to extract recognized text from individual strokes, generate content suitable for indexing in search systems such as Spotlight, and search for specific words or phrases within handwritten content. The recognizer uses an on-device recognition engine and all operations are asynchronous.
Recognition works best when handwriting is scaled as if drawn on standard US Letter or A4 paper in points. Before creating a recognizer, check supportedLanguages to confirm your target language is available. If you persist results from a recognizer, store the current recognitionVersion alongside the results and regenerate them when the version advances.