This is your go-to reference when you need to add drawing or annotation features to an iOS app. It covers the essentials: setting up PKCanvasView, managing the tool picker, serializing drawings to disk, exporting to images, and wrapping everything in SwiftUI. The stroke inspection section is especially useful if you need to analyze what users drew rather than just save a static image. One thing to know: the drawing policy options matter more than you'd think. Default mode lets Apple Pencil draw while fingers scroll, but you'll probably want anyInput for most annotation use cases. The SwiftUI wrapper example is clean and handles the delegate pattern correctly, which saves you from the usual UIViewRepresentable headaches.

skills.sh installs
3.3K
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add dpearson2699/swift-ios-skills --skill pencilkit --agent claude-code

Installs into .claude/skills of the current project.

Files

PencilKit

Capture Apple Pencil and finger input using PKCanvasView, manage drawing tools with PKToolPicker, serialize drawings with PKDrawing, and wrap PencilKit in SwiftUI.

Contents

Setup

PencilKit requires no entitlements or Info.plist entries. Import PencilKit and create a PKCanvasView.

import PencilKit

Platform availability: iOS 13+, iPadOS 13+, Mac Catalyst 13.1+, visionOS 1.0+.

Capture-to-Export Workflow

Sponsors

Details

Repository
github.com/dpearson2699/swift-ios-skills
Categories
Release Management, Mobile Development
First seen
May 16, 2026

More from dpearson2699/swift-ios-skills

All 98
1arize-ai avatararize-datasetarize-ai/arize-skillsCreates, manages, and queries Arize datasets and examples. Covers dataset CRUD, appending examples, exporting data, and file-based dataset creation using the ax3.2Kskills.sh installs
2getsentry avatarsentry-sdk-upgradegetsentry/sentry-for-aiUpgrade the Sentry JavaScript SDK across major versions. Use when asked to upgrade Sentry, migrate to a newer version, fix deprecated Sentry APIs, or resolve br3.2Kskills.sh installs
3hashicorp avatarpush-to-registryhashicorp/agent-skillsPush Packer build metadata to HCP Packer registry for tracking and managing image lifecycle. Use when integrating Packer builds with HCP Packer for version cont3.1Kskills.sh installs
4openclaw avatarautoreviewopenclaw/agent-skillsRun a structured code review (Codex default, optional Claude, Pi, Droid, Copilot, or OpenCode) as a closeout check on a local or PR branch before commit or ship3.1Kskills.sh installs
5himself65 avataryc-readerhimself65/finance-skillsLook up Y Combinator companies, batches, and startup ecosystem data using the yc-oss API (read-only). Use this skill whenever the user wants to research YC-back3.1Kskills.sh installs
6phuryn avatarab-test-analysisphuryn/pm-skillsAnalyze A/B test results with statistical significance, sample size validation, confidence intervals, and ship/extend/stop recommendations. Use when evaluating 3Kskills.sh installs