pencilkit

Capture Apple Pencil drawings with PKCanvasView and persist PKDrawing data.

Updated May 6, 2026
One-click install
npx skills add https://github.com/Roy-wonji/claude-config --skill pencilkit-roy-wonji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pencilkit
Source: https://github.com/Roy-wonji/claude-config/tree/main/skills/swift-ios-skills/skills/pencilkit
Command: npx skills add https://github.com/Roy-wonji/claude-config --skill pencilkit-roy-wonji

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the problem of building iOS drawing and annotation features that feel natural with Apple Pencil while still being persistable and reusable in apps.

Core Features & Use Cases

  • Capture drawing input: Use PKCanvasView to record Apple Pencil and finger strokes with configurable drawing policies.
  • Provide drawing tools: Use PKToolPicker to present an in-app tool palette and support tool changes.
  • Persist and transfer drawings: Serialize drawings with PKDrawing to save/load data and enable document-style workflows.
  • Integrate with SwiftUI: Wrap PKCanvasView using UIViewRepresentable for reactive SwiftUI state management.
  • Use cases: annotation tools, handwriting capture, signature fields, and any Pencil-powered drawing experience on iOS/iPadOS/visionOS.

Quick Start

Ask the skill to show how to capture Pencil and finger strokes with PKCanvasView, attach a PKToolPicker, and persist the resulting PKDrawing to Data for later reload.

Frequently Asked Questions about pencilkit

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

FAQPage Schema
How do I integrate Apple Pencil drawing into a SwiftUI app?

You can provide drawing tools in your iOS app by attaching PKToolPicker to the PKCanvasView. This presents an in-app tool palette that supports dynamic tool changes for Apple Pencil and finger input capture.

How do I persist PencilKit drawings for later use?

Persist PencilKit drawings by serializing the PKDrawing object using dataRepresentation. You can later reload the drawing data by initializing it with PKDrawing(data:), enabling reliable save and load workflows.

Can I use PencilKit to build a signature or annotation app?

Yes, PencilKit is suited for building annotation, handwriting, and signature apps. By configuring PKCanvasView with specific drawing policies, you can capture freeform markup and signature inputs reliably across iOS, iPadOS, and visionOS.

What is the best way to export a PencilKit drawing as an image?

Exporting a PencilKit drawing as a rendered image is supported alongside drawing serialization. After capturing strokes in PKCanvasView, you can optionally export the drawing as an image while also persisting the vector data.

Does PencilKit support visionOS for freeform markup?

PencilKit supports freeform markup and drawing capture on visionOS, alongside iOS and iPadOS. You can use PKCanvasView and PKToolPicker to build consistent Pencil-powered drawing experiences across these platforms.