pencilkit

Capture Apple Pencil and touch drawings with PencilKit on iOS.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill pencilkit-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pencilkit
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/pencilkit
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill pencilkit-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PencilKit helps you add reliable Apple Pencil (and finger) drawing capture, tool selection, and persistence to your iOS/iPadOS app so users can draw, annotate, and save ink without reinventing low-level touch rendering.

Core Features & Use Cases

  • Ink capture with PKCanvasView: Capture strokes from Pencil and/or finger using configurable drawing policies for drawing, annotation, or handwriting input.
  • Tool selection with PKToolPicker: Provide an on-canvas tool palette (pens, erasers, rulers, lasso/ruler items) and apply the selected tool to the active canvas.
  • Persistence and interchange with PKDrawing: Serialize drawings using PKDrawing dataRepresentation() and recreate them with PKDrawing(data:) for saving documents, syncing, or resuming sessions.
  • Export and analysis: Render drawings to UIImage for thumbnails or sharing, and inspect strokes/stroke paths for advanced features like scoring, review, or analytics.

Quick Start

Use the PencilKit canvas workflow to capture input in a PKCanvasView, control tools via a PKToolPicker, and persist the result by saving a PKDrawing using its dataRepresentation().

Frequently Asked Questions about pencilkit

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

FAQPage Schema
How do I capture Apple Pencil drawings in a SwiftUI app?

Capture Apple Pencil drawings by configuring a PKCanvasView with a specific drawingPolicy and delegate hooks. This allows your SwiftUI application to natively capture both Pencil and touch input for interactive annotation or handwriting.

Can I display a tool picker for Apple Pencil input on iPadOS?

Yes, you can display an on-canvas tool palette by integrating PKToolPicker. It provides pens, erasers, rulers, and lasso items, allowing users to select tools that are then applied directly to the active PKCanvasView.

How do I export a PencilKit drawing to an image for sharing?

Export PencilKit drawings to a UIImage for sharing or thumbnails by rendering the captured strokes. You can also inspect individual stroke paths for advanced features like analytics or review.

Does PencilKit work with visionOS and iOS for handwriting capture?

PencilKit supports iOS, iPadOS, and visionOS for handwriting capture. It requires setting up the canvas with appropriate drawing policies to accurately capture and process touch or Pencil input.

What is the best way to add annotation features to an existing canvas?

The best way to add annotation is using PKCanvasView to capture strokes and PKToolPicker for tool management. This approach handles low-level touch rendering natively, preventing the need to build custom rendering logic.