-
使用 PencilKit 解读笔触之间的奥秘
运用“无边记”和“备忘录”等 Apple App 背后的强大技术,为你的 App 解锁手写识别功能。了解如何在各种字母和语言中使用手写识别,并探索如何利用新功能将 PencilKit 整合到多种多样的 App 中。
章节
- 0:00 - Introduction
- 3:25 - Handwriting recognition
- 8:38 - Path conversion
- 10:21 - Improved model access
- 11:25 - Stroke slicing
- 13:48 - Next steps
资源
- Controlling stroke rendering for animation and editing
- Recognizing handwriting and converting it to text
- Building a handwriting recognition experience with PencilKit
- PencilKit
相关视频
WWDC26
WWDC25
WWDC20
-
搜索此视频…
-
-
3:53 - Recognized text
import PencilKit let recognizer = PKStrokeRecognizer() await recognizer.updateDrawing(drawing) myLabel.text = await recognizer.recognizedText() -
5:22 - Indexable content
import PencilKit let recognizer = PKStrokeRecognizer() await recognizer.updateDrawing(drawing) if let indexedContent = await recognizer.indexableContent { index(text: indexedContent) } -
6:58 - Find text
import PencilKit let recognizer = PKStrokeRecognizer() await recognizer.updateDrawing(drawing) let results = await recognizer.search("apple") for result in results { highlight(bounds: result.bounds) }
-
-
- 0:00 - Introduction
Meet the PencilKit APIs behind handwriting in Notes and Freeform, now available to your apps in iOS 27.
- 3:25 - Handwriting recognition
Use the stroke recognizer API for on-device text recognition, indexing, search, and accessibility.
- 8:38 - Path conversion
Converting PKStrokePath to and from Bézier paths without losing fidelity, so apps that store strokes as Bézier can build PKDrawings and use handwriting recognition on any canvas, not just PKCanvasView.
- 10:21 - Improved model access
Deeper access to the drawing model in iOS 27 — stable Identifiable stroke IDs that survive edits and undo, controllable canvas selection with a change delegate, and adjustable wet-ink render groups.
- 11:25 - Stroke slicing
Two ways to slice strokes — programmatic erasing that cuts one stroke into independent strokes, and substroke extraction with parametric ranges — along with performance considerations for complex drawings.
- 13:48 - Next steps
Ways to put these APIs to work: adopt PKStrokeRecognizer for handwriting recognition, convert existing Bézier paths, track strokes with stable identity, and use stroke slicing for erasing and animation.