pencilkit

Installation
SKILL.md

PencilKit

Apple's low-latency stroke-drawing engine — the ink behind Notes, Markup, and Screenshots. It captures Apple Pencil and finger input into vector strokes, renders them with a hardware-accelerated pipeline, and gives you a serializable model (PKDrawing) plus the system tool palette (PKToolPicker). Available iOS 13+. The deep API reference — canvas setup, SwiftUI wrapping, the tool picker, tools, persistence, image rendering, drawing policy, undo, Pencil Pro, and the PaperKit boundary — lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics.

Dials

Set these explicitly at the start; they change what "correct" means.

  1. HOST — uikit (native; PKCanvasView is a UIKit view, default) · swiftui-representable (wrap PKCanvasView in a UIViewRepresentable with a Coordinator that owns the delegate and the tool picker — there is no first-party SwiftUI canvas).
  2. TOOLPICKER — shared (use a single long-lived PKToolPicker() for the system palette, default) · none (custom toolbar; you set canvasView.tool yourself and forfeit the Pencil-squeeze palette gesture).
  3. INPUT — any (drawingPolicy = .anyInput; finger and pencil both draw) · pencil-only (drawingPolicy = .pencilOnly; pencil inks, finger pans/scrolls — the natural scrollable-canvas experience) · default (.default; respects the user's system "Draw with Apple Pencil" setting).

When to use

Reach for PencilKit when you need freehand strokes only — a sketch pad, signature capture, handwriting input, or a pure-ink annotation overlay. It's lightweight and ships back to iOS 13. If you need structured markup elements (shapes, text boxes, stickers, images) and the system insertion UI on top of drawing, use PaperKit instead — PaperKit (iOS 26+) wraps a PencilKit drawing and adds the markup layer. Don't reimplement shapes/text on a bare PKCanvasView.

Core rules

Installs
1
GitHub Stars
1
First Seen
Jun 18, 2026
pencilkit — moritztucher/swift-agent-skills