An actor that recognizes handwritten strokes and searches for text in a drawing.
Members (8)
method · iOS 27.0+
updateDrawing
TypeScript
updateDrawing(drawing: PKDrawing): Promise<void>
Swift declaration
final func updateDrawing(_ drawing: PKDrawing) async
Updates the drawing the recognizer analyzes.
Recognition expects handwriting and strokes scaled as if written on standard paper
sizes in points, such as US-letter or A4.
- Parameter drawing: The new drawing.
final func recognizedText(strokeIDs: Set<UUID>? = nil) async -> String?
Returns the recognized text from the specified strokes in the drawing.
- Parameter strokeIDs: The `id`s of the `PKStrokes` in `drawing` to analyze.
Pass `nil` to return the recognized text from the whole drawing.
get · iOS 27.0+
unownedExecutor
TypeScript
get unownedExecutor(): SDKHandle
Swift declaration
nonisolated final var unownedExecutor: UnownedSerialExecutor { get }
Retrieve the executor for this actor as an optimized, unowned
reference.
This property must always evaluate to the same executor for a
given actor instance, and holding on to the actor must keep the
executor alive.
This property will be implicitly accessed when work needs to be
scheduled onto this actor. These accesses may be merged,
eliminated, and rearranged with other work, and they may even
be introduced when not strictly required. Visible side effects
are therefore strongly discouraged within this property.
- SeeAlso: ``SerialExecutor``
- SeeAlso: ``TaskExecutor``
get · iOS 27.0+
indexableContent
TypeScript
get indexableContent(): Promise<(string) | null>
Swift declaration
final var indexableContent: String? { get async }
A string suitable for indexing the drawing's recognized text in search systems such as Spotlight.
The string may contain multiple concatenated candidate matches for recognized text in the drawing.
- Important: This query runs low-priority background recognition. Interactive queries can cancel it,
in which case it returns nil. Use the indexing query when the person isn't interacting with the device.
Creates a recognizer with the specified preferred languages.
Languages are respected on a best-effort basis. Factors such as feature support
may affect which languages the recognizer uses.
- Parameters:
- preferredLanguages: A list of languages to recognize ordered by descending priority.
Pass nil to use the system languages.
The system languages may be used if no listed language is available for recognition.
get · iOS 27.0+
recognitionVersion
TypeScript
static get recognitionVersion(): number
Swift declaration
static var recognitionVersion: Int { get }
The version number of the recognition engine.
If you persist results this recognizer returns, store this value alongside them
and regenerate the results when running on an OS with a higher version number.
get · iOS 27.0+
supportedLanguages
TypeScript
static get supportedLanguages(): Array<_Foundation_Locale_Language>
Swift declaration
static var supportedLanguages: Set<Locale.Language> { get }
Searches the drawing for strokes whose recognized text matches the query.
- Parameters:
- query: The query string to search for.
- fullWordsOnly: Restricts matches to whole words only.
- caseMatchingOnly: Restricts matches to exact case.
- Returns: An array of all results found.
Skipped declarations
2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
PKStrokeRecognizer.drawing
The iOS SDK compiler rejected this binding: actor-isolated property 'drawing' can not be referenced from a nonisolated context
PKStrokeRecognizer.languages
The iOS SDK compiler rejected this binding: actor-isolated property 'languages' can not be referenced from a nonisolated context