
Pencilkit
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-codeInstalls 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
- Capture-to-Export Workflow
- PKCanvasView Basics
- PKToolPicker
- PKDrawing Serialization
- Content Version Compatibility
- Exporting to Image
- Stroke Inspection
- SwiftUI Integration
- PaperKit Relationship
- Common Mistakes
- Review Checklist
- References
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- Carplay3.2K
- Ios Simulator3.2K
- Scenekit3.2K
- Homekit3.2K
- Accessorysetupkit3.2K
- Callkit3.2K
- Cryptotokenkit3.2K
- Financekit3.2K
- Adattributionkit3.2K
- Paperkit3.2K
- Passkit3.2K
- Audioaccessorykit3.2K
- Dockkit3.2K
- Browserenginekit3.2K
- Appmigrationkit3.2K
- Relevancekit3.2K
- Sensorkit3.2K
- Swift Security3.2K
- Tabletopkit3.1K
- App Store Optimization3.1K
- Swift Api Design Guidelines3K
- Swiftlint2.9K
- Swift Formatstyle2.8K
- Core Data2.8K