pencilkit

Wrap PKCanvasView and PKToolPicker to add Apple Pencil drawing to iOS apps.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/harshav167/build-ios-apps --skill pencilkit-harshav167
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pencilkit
Source: https://github.com/harshav167/build-ios-apps/tree/main/skills/pencilkit
Command: npx skills add https://github.com/harshav167/build-ios-apps --skill pencilkit-harshav167

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PencilKit provides a ready-to-use drawing and annotation canvas for iOS apps, enabling developers to capture Apple Pencil and finger input with a programmable tool system and minimal boilerplate.

Core Features & Use Cases

  • PKCanvasView basics for capturing pencil and finger strokes.
  • PKToolPicker for tool customization and real-time drawing control.
  • PKDrawing serialization and loading for persistence and cross-device sharing.
  • SwiftUI integration and PaperKit relationship to support markup workflows and structured annotations.

Quick Start

Create a PencilKit canvas, attach a tool picker, and serialize drawings for save/load.

Frequently Asked Questions about pencilkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Apple Pencil drawing to a SwiftUI app?

To add Apple Pencil drawing to a SwiftUI app, use PencilKit to wrap PKCanvasView and PKToolPicker, enabling finger and pencil strokes with minimal boilerplate. It provides a ready-to-use annotation canvas for iOS apps.

How do I serialize and load PKDrawing data in iOS?

To serialize and load PKDrawing data in iOS, use the dataRepresentation method to save strokes and reload them via PKDrawing(data:). This handles persistence, cross-device sharing, and content-version compatibility.

Can I use PKToolPicker for real-time customization on iPadOS?

Yes, you can use PKToolPicker for real-time customization on iPadOS. PencilKit attaches the tool picker to your canvas, allowing programmatic tool switching and drawing control with a dedicated tool-picker observer lifecycle.

Does PencilKit work with PaperKit for markup workflows?

PencilKit works with PaperKit for markup workflows and structured annotations. It supports SwiftUI integration and PaperKit handoffs on iPadOS and iOS, managing the canvas and tool-picker observer lifecycle.

What are the limitations of wrapping PKCanvasView in SwiftUI?

Limitations of wrapping PKCanvasView in SwiftUI include managing the tool-picker observer lifecycle manually and handling content-version compatibility errors during PKDrawing serialization and loading to prevent data loss.