PaperKit
Beta-sensitive. PaperKit is new in iOS/iPadOS 26, macOS 26, and visionOS 26. API surface may change. Verify details against current Apple documentation before shipping.
PaperKit combines PencilKit drawing with structured markup elements such as shapes, text, images, and lines in a canvas managed by PaperMarkupViewController.
Contents
- Setup
- Workflow
- PaperMarkupViewController
- PaperMarkup Data Model
- Insertion Controllers
- FeatureSet Configuration
- Integration with PencilKit
- SwiftUI Integration
- Common Mistakes
- Review Checklist
- References
Workflow
- Choose the document bounds, supported
FeatureSet, and persistence version before constructing UI. - Create
PaperMarkup, embedPaperMarkupViewController, and keep the controller, tool picker, and insertion controller alive for the view lifetime. - Use the platform-appropriate insertion surface and keep PencilKit drawing inside the PaperKit document boundary.
- Save off the main thread, retain a thumbnail for forward-incompatible content, and test round-trip loading with the same feature set.
- On failure, restore the original document bytes, fix the feature-set/version/controller mismatch, and rerun edit, save, relaunch, load, thumbnail fallback, and undo checks.
Load references/paperkit-patterns.md [blocked] for full platform setup, tool picker wiring, persistence, thumbnails, custom feature sets, programmatic construction, and migration.
Setup
PaperKit requires no entitlements or special Info.plist entries.
Platform availability: iOS 26.0+, iPadOS 26.0+, Mac Catalyst 26.0+, macOS 26.0+, visionOS 26.0+.
Three core components:
PaperMarkupViewController
The primary view controller for interactive markup. Provides a scrollable canvas for freeform PencilKit drawing and structured markup elements. Conforms to Observable and PKToolPickerObserver.
Basic UIKit Setup
Key Properties
Touch Modes
PaperMarkupViewController.TouchMode has two cases: .drawing and .selection.
Content Background
Set any view beneath the markup layer for templates, document pages, or images being annotated. Keep the PaperMarkup(bounds:) coordinate space aligned to the background content, such as a PDF page or rendered image size, so saved annotations restore in the right place:
Delegate Callbacks
PaperMarkup Data Model
PaperMarkup is a Sendable struct that stores all markup elements and PencilKit drawing data.
Creating and Persisting
Inserting Content Programmatically
Shape types: .rectangle, .roundedRectangle, .ellipse, .line, .arrowShape, .star, .chatBubble, .regularPolygon.
Other Operations
Use suggestedFrameForInserting(contentInFrame:) on the view controller to get a frame that avoids overlapping existing content.
Insertion Controllers
MarkupEditViewController (iOS, iPadOS, Mac Catalyst, visionOS)
Presents a popover menu for inserting shapes, text boxes, lines, and other elements.
MarkupToolbarViewController (macOS, Mac Catalyst)
Provides a toolbar with drawing tools and insertion buttons. Use it for native macOS and for Mac Catalyst toolbar-style UI; Catalyst apps that want a UIKit popover can use MarkupEditViewController.
Both controllers must use the same FeatureSet as the PaperMarkupViewController.
FeatureSet Configuration
FeatureSet controls which markup capabilities are available.
Customizing
Available Features
HDR Support
Set colorMaximumLinearExposure above 1.0 on both the FeatureSet and PKToolPicker:
Use view.window?.windowScene?.screen.potentialEDRHeadroom to match the device screen's capability. Use 1.0 for SDR-only.
Shapes, Inks, and Line Markers
Integration with PencilKit
PaperKit accepts PKTool for drawing and can append PKDrawing content.
PaperKit is not a drop-in replacement for a low-level PKCanvasView when the app depends on custom brush behavior, raw PKDrawing / PKStroke analytics, or custom lasso-centric editing. Keep those workflows owned by PencilKit, and add PaperKit beside them for structured review markup such as callouts, arrows, text boxes, labels, image stamps, and system-standard insertion UI. Migrate or duplicate existing drawings into a PaperKit annotation layer with PaperMarkup.append(contentsOf: PKDrawing) only when the low-level editing path no longer needs to own that content.
Tool Picker Setup
Setting toolPickerVisibility to .hidden keeps the picker functional (responds to Pencil gestures) but not visible, enabling the mini tool picker experience.
Content Version Compatibility
FeatureSet.ContentVersion maps to PKContentVersion:
SwiftUI Integration
Wrap PaperMarkupViewController in UIViewControllerRepresentable:
Initialize the bound PaperMarkup from the document or page size before creating the SwiftUI bridge:
Common Mistakes
Review Checklist
-
import PaperKitpresent; deployment target is iOS 26+ / macOS 26+ / visionOS 26+ -
PaperMarkupinitialized with bounds matching content size - Same
FeatureSetused forPaperMarkupViewControllerand insertion controller -
dataRepresentation()called in async context -
PKToolPickerretained as a stored property - Delegate set on
PaperMarkupViewControllerfor change callbacks - Content version checked when loading saved data
- Correct insertion controller per platform (
MarkupToolbarViewControllerfor macOS/Catalyst toolbar UI;MarkupEditViewControllerfor UIKit/Catalyst popovers) -
MarkupErrorcases handled on deserialization - HDR:
colorMaximumLinearExposureset onFeatureSetandPKToolPicker.colorMaximumLinearExposure
References
- PaperKit documentation
- Integrating PaperKit into your app
- Meet PaperKit — WWDC25
- The
pencilkitskill covers PencilKit drawing, tool pickers, and PKDrawing serialization - references/paperkit-patterns.md [blocked] — data persistence, rendering, multi-platform setup, custom feature sets


