What problem does it solve?
PencilKit helps you add reliable Apple Pencil (and finger) drawing capture, tool selection, and persistence to your iOS/iPadOS app so users can draw, annotate, and save ink without reinventing low-level touch rendering.
Core Features & Use Cases
- Ink capture with PKCanvasView: Capture strokes from Pencil and/or finger using configurable drawing policies for drawing, annotation, or handwriting input.
- Tool selection with PKToolPicker: Provide an on-canvas tool palette (pens, erasers, rulers, lasso/ruler items) and apply the selected tool to the active canvas.
- Persistence and interchange with PKDrawing: Serialize drawings using PKDrawing dataRepresentation() and recreate them with PKDrawing(data:) for saving documents, syncing, or resuming sessions.
- Export and analysis: Render drawings to UIImage for thumbnails or sharing, and inspect strokes/stroke paths for advanced features like scoring, review, or analytics.
Quick Start
Use the PencilKit canvas workflow to capture input in a PKCanvasView, control tools via a PKToolPicker, and persist the result by saving a PKDrawing using its dataRepresentation().