◉RORK LABJP
●MCP — Rork now lets you add and manage your own MCP servers inside Plugins (11/21)●2.5 ROUTE — From 12/1, apps calling gemini-2.5-flash are routed to 3.5 Flash-Lite and billed at its rates (9 days left)●CHANNEL — Users report Android notification channel reads and writes failing in Expo Go●NEW — New: three clues to check before replying to a stuck-on-splash review●EXPORT — Export your projects before you downgrade or cancel a plan●SONNET 4.5 — Apps that call Sonnet 4.5 through the API should switch before it retires on 11/30●MCP — Rork now lets you add and manage your own MCP servers inside Plugins (11/21)●2.5 ROUTE — From 12/1, apps calling gemini-2.5-flash are routed to 3.5 Flash-Lite and billed at its rates (9 days left)●CHANNEL — Users report Android notification channel reads and writes failing in Expo Go●NEW — New: three clues to check before replying to a stuck-on-splash review●EXPORT — Export your projects before you downgrade or cancel a plan●SONNET 4.5 — Apps that call Sonnet 4.5 through the API should switch before it retires on 11/30
Articles/Dev Tools
⬡ Dev Tools/2026-05-03Advanced

Building a Production-Grade Handwriting Note App with Rork × PencilKit

How to ship a real PencilKit-based note app with Rork — covering Apple Pencil Pro Squeeze and Hover, PKDrawing persistence, CloudKit sync, and Vision-based handwriting OCR with production patterns.

Rork620PencilKitApple PenciliPad appSwiftUI66Handwriting

✦ Premium Article

If you have ever tried building a handwriting note app for iPad, you probably had the same arc I did: dropped a PKCanvasView in, felt great for ten minutes, then hit a wall the second you wanted to save the drawing, support Apple Pencil Pro's Squeeze gesture, or sync notes across devices.

I have been shipping handwriting-focused iPad apps for the past three years, and PencilKit is one of the most deceptively simple frameworks Apple has produced. The gap between "it works on screen" and "it can compete on the App Store" is much wider than the API surface suggests.

This guide walks through the patterns I have actually used — and the mistakes I have actually made — when building PencilKit-backed apps with Rork (in particular Rork Max generating SwiftUI native code). We will cover Apple Pencil Pro features (Squeeze, Barrel Roll, Hover, Haptics), persisting PKDrawing, syncing with CloudKit, and adding searchability via Vision-based handwriting OCR — all as production-ready patterns.

Why pick PencilKit at all — the trade-off versus rolling your own

There is one architectural decision you cannot avoid: should the drawing layer be PencilKit, a custom Metal renderer, or a third-party SDK like PSPDFKit?

When in doubt, I always pick PencilKit, for three reasons.

First, you get Apple Pencil Pro features (Squeeze, Barrel Roll, Hover) almost for free. If you build your own renderer, you have to wire up UIPencilInteraction, UIHoverGestureRecognizer, the haptic engine, and detection logic for Pencil generations — every single piece by hand.

Second, Apple keeps polishing PencilKit each year, and PKToolPicker matches the look and feel of the system Notes and Freeform apps. Users come in expecting that interaction model, so matching it is itself a UX win.

Third, you get Scribble (handwriting-to-text on input) and PKDrawing.image() for fast rasterization completely free. Building OCR or PDF rendering of comparable quality on your own takes months.

The case where PencilKit is the wrong call is when complex layer systems or a custom brush engine are the core product (think Procreate). For the typical "notes / meetings / study / PDF annotation" category, PencilKit is the right answer — and that is what this article focuses on.

Architecture overview — keeping responsibilities clean in Rork

Before writing a line of code in Rork, decide where SwiftUI ends and UIKit begins. PKCanvasView is UIKit, so a UIViewRepresentable bridge is mandatory.

The four-layer setup I use looks like this:

  • View layer (SwiftUI): note list, toolbar, page thumbnails
  • Canvas layer (UIViewRepresentable): bridges PKCanvasView and PKToolPicker
  • Document layer (@Observable): holds PKDrawing and Page state, owns Undo/Redo
  • Persistence layer: a repository that abstracts FileManager and CloudKit

When you prompt Rork Max, declare these layers explicitly. Saying something like "create a CanvasRepresentable that exposes PKCanvasView to SwiftUI, and pipe PKDrawing into a @Bindable Document" keeps the generated code consistent through later sync and OCR work.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦If you got stuck once you tried PencilKit beyond a one-liner — laggy strokes, the tool picker not showing, no clue how to support Apple Pencil Pro Squeeze — you can leave today with production-grade code that does all of it
✦You will learn how to persist PKDrawing properly and sync notes across devices with a realistic CloudKit + CKAsset architecture, debounced and conflict-aware
✦You can transplant a complete monetization recipe — Pencil Pro support, subscription gating, and OCR search — into your own handwriting app
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Dev Tools2026-04-23
Integrating Siri and Shortcuts into Rork Apps: App Intents with Expo, Without the Pitfalls
A production-grade guide to adding Siri Shortcuts and App Intents to a React Native app generated by Rork. Bridge native Swift via an Expo Config Plugin, model AppShortcut / AppEntity / EntityQuery correctly, and ship Donations and Control Center widgets without breaking Apple's conventions.
⬡ Dev Tools2026-11-19
New Wallpapers Showed Up Everywhere Except the Filters: Ship the Count and the Category Lists Together
I added 67 wallpapers in one batch. They appeared in the full list and in New, but not under a single category filter, because I had raised the ID limit and forgotten to ship the category lists. Here is a pre-bump check, a client-side way to spot silent fallbacks in an Expo app, and a post-release count against the origin.
⬡ Dev Tools2026-11-04
Catching the Few Seconds Before Streaming Audio Starts: A Loading State and a Timeout
You tap play and nothing happens for a moment. Here is how I model that gap with expo-audio: a requested flag, a 400ms delayed spinner, and an 8-second timeout.