◉RORK LABJP
●GPT6.1 — GPT-6.1 Sol joined the Rork model menu (Sep 29). It is the latest entry on the changelog●10/12 — 7 days left until React Native 0.88.x is due. Expo SDK 58 stable is only described as early October●NEW — Multiseat Purchases Are Already On: Decide Whether to Keep Them Before October 22●SDK 58 — A fix PR (#50998) for npm install failing in new projects is under review. No stable date has been given yet●SONNET — Claude Sonnet 5.5 is now in Rork (Sep 28). It is described as over 30% faster than Sonnet 5●iOS 27 — From April 2027, App Store uploads require the iOS 27 SDK. There is time to update your build environment calmly●GPT6.1 — GPT-6.1 Sol joined the Rork model menu (Sep 29). It is the latest entry on the changelog●10/12 — 7 days left until React Native 0.88.x is due. Expo SDK 58 stable is only described as early October●NEW — Multiseat Purchases Are Already On: Decide Whether to Keep Them Before October 22●SDK 58 — A fix PR (#50998) for npm install failing in new projects is under review. No stable date has been given yet●SONNET — Claude Sonnet 5.5 is now in Rork (Sep 28). It is described as over 30% faster than Sonnet 5●iOS 27 — From April 2027, App Store uploads require the iOS 27 SDK. There is time to update your build environment calmly
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.

Rork575PencilKitApple 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 $15 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-09-21
A build that stops with exit code 0 — the flag that silenced the log, and the check that let an empty file through
Two reports landed in the same week: eas build --local stopping with exit code 0 but produced no further output, and a zero-byte stub that never got embedded. Both came down to settings that reduce output. Here is how to audit your own scripts.
⬡ Dev Tools2026-09-19
Reading only what Rork changed: the diff routine I run after every re-export
How to read a fresh Rork export as a diff against the last one: clear tracked files before you copy, strip the noise before you count, and stop once before the merge commit lands.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links