Integrates PencilKit and PaperKit for drawing, handwriting, and sketching in iOS/iPadOS apps. Covers PKCanvasView, PKToolPicker, PKDrawing, stroke management, and SwiftUI bridging.
Ships in all-ios-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Integrate drawing, sketching, and annotation into iOS and iPadOS apps using PencilKit (PKCanvasView, PKToolPicker, PKDrawing) and PaperKit. Targets Swift 6.4 / iOS 26+.
| Component | Responsibility |
|---|---|
PKCanvasView | Scrollable drawing canvas that receives touch and pencil inputs; inherits from UIScrollView |
PKToolPicker | Floating system tool palette offering pens, pencils, markers, erasers, rulers, and custom tools |
PKDrawing | Immutable data model containing vector strokes (PKStroke), stroke points, and bounds |
PKTool | Active drawing instrument (PKInkingTool, PKEraserTool, PKLassoTool) |
PKCanvasViewDelegate | Notifies when drawing changes or user starts/ends drawing |
Bridge PKCanvasView into SwiftUI using UIViewRepresentable:
import SwiftUI
import PencilKit
struct CanvasViewRepresentable: UIViewRepresentable {
@Binding var drawing: PKDrawing
var tool: PKTool = PKInkingTool(.pen, color: .black, width: 5)
var isRulerActive: Bool = false
func makeUIView(context: Context) -> PKCanvasView {
let canvas = PKCanvasView()
canvas.drawingPolicy = .anyInput
canvas.tool = tool
canvas.isRulerActive = isRulerActive
canvas.delegate = context.coordinator
return canvas
}
func updateUIView(_ uiView: PKCanvasView, context: Context) {
if uiView.drawing != drawing {
uiView.drawing = drawing
}
uiView.tool = tool
uiView.isRulerActive = isRulerActive
}
func makeCoordinator() -> Coordinator { Coordinator(self) }
class Coordinator: NSObject, PKCanvasViewDelegate {
var parent: CanvasViewRepresentable
init(_ parent: CanvasViewRepresentable) { self.parent = parent }
func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) {
Task { @MainActor in parent.drawing = canvasView.drawing }
}
}
}
drawing.dataRepresentation(). Restore via PKDrawing(data:).drawing.image(from: canvasView.bounds, scale: canvasView.traitCollection.displayScale).drawing.strokes to inspect points, pressure, force, and azimuth.Configure canvasView.drawingPolicy:
.default: Follows system preference (Apple Pencil only if configured in Settings)..anyInput: Allows finger drawing alongside Apple Pencil..pencilOnly: Restricts drawing strictly to Apple Pencil; finger touches scroll the canvas.Coordinating PKToolPicker: Attach the picker with toolPicker.setVisible(true, forFirstResponder: canvasView) and toolPicker.addObserver(canvasView). Ensure the canvas becomes first responder.
PKToolPicker (iOS 18+), read Custom Tool Picker Items.UndoManager, read Undo/Redo Support.__PKStrokeRenderState is renamed PKStrokeRenderStateReference. Its initializer replaces PKStrokeRenderState.asObjCRenderState().Sources: https://sosumi.ai/documentation/ios-ipados-release-notes/ios-ipados-27-release-notes
canvasView.becomeFirstResponder() before showing PKToolPicker.@Binding var drawing continuously during drawing gestures, causing hitching and feedback loops.drawingPolicy = .pencilOnly.PKToolPicker floats automatically in SwiftUI without anchoring to a window or first responder.PKCanvasView embedded in SwiftUI with a clean CoordinatordrawingPolicy explicitly set (.anyInput, .pencilOnly, or .default)PKToolPicker tied to canvas first responder and visible statedataRepresentation() and restored with error handlingundoManagerPKToolPicker obscures canvas regionsWhat SKILL.md sets; muted values are Claude Code's defaults
/all-ios-skills:pencilkitfrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job