PencilKit
Capture touch and Apple Pencil input as a drawing, and display that content from your app.
Overview
PencilKit makes it easy to incorporate hand-drawn content into your iPadOS or macOS apps. PencilKit provides a drawing environment for your iOS app that receives input from Apple Pencil or the user’s finger, and turns it into images you display in iPadOS, iOS, or macOS. The environment comes with tools for creating, erasing, and selecting lines.
You capture content in your iPad app using a PKCanvasView object that you integrate into your existing view hierarchy. It supports the low-latency capture of touches originating from Apple Pencil or your finger. The canvas object sends final results as a PKDrawing object, whose contents you can save with your app’s content. You can also convert the drawn content into an image for display in iOS or macOS app.
For information about handling user interactions on Apple Pencil in your UIKit app, see Apple Pencil interactions.
Topics
Canvas
Drawing with PencilKitCustomizing Scribble with InteractionsInspecting, Modifying, and Constructing PencilKit DrawingsImporting Bézier path data into PencilKitControlling stroke rendering for animation and editingPKCanvasViewPKDrawingPKStrokePKStrokePathPKStrokePointPKInk
Handwriting recognition
Building a handwriting recognition experience with PencilKitRecognizing handwriting and converting it to textPKStrokeRecognizer