Apple introduced PencilKit at WWDC 2019 this week for much easier implementation of Apple Pencil experiences in third-party apps. The new framework will allow devs to tap into the same low latency and the new Apple Pencil tool palette and “markup anywhere” features that Apple itself uses for drawing and annotating in its own apps.
Lower latency with PencilKit
Apple is already using PencilKit across the entire system in iOS 13 including in Notes for low latency drawing and note taking, in Pages for marking up documents, and with its “markup anywhere” feature for annotating screenshots and PDFs.
The new APIs require just three lines of code for developers to get the same low latency, UI, and tool palette that Apple uses for Pencil. That includes the drop from 20 milliseconds to 9 milliseconds latency that Apple announced during its unveiling of iPadOS.
Previously, developers would have to build their own engine for many of these features and that required a significant amount of work to implement, Apple noted during its introduction of PencilKit at WWDC. The new APIs make it easy for any developer to implement drawing and annotation features on par with the Apple Pencil support in iOS 13.
Apple provided early access to Pinterest and Canvas and said the companies have used it to implement the new Apple Pencil features in their apps.
New Dynamic Tool Picker & Expressive Inks
A big part of what developers get access to with the APIs is Apple’s canvas and new dynamic tool picker (pictured above) with pen, marker, pencil, eraser, and lasso tools. That includes Apple’s expressive, responsive inks and drawing models that it uses in apps like Notes and Pages.
Some of this new feature set was shown briefly by Apple on stage to demo new and improved “markup anywhere” features for annotating screenshots and PDFs – now integrated system-wide with support for editing full documents and more. With the introduction of PencilKit, developers will be able to much more easily offer users access to the markup controls to draw or annotate in third-party apps too, even for apps that might not use Apple Pencil as the main input device.
Developers interested in learning more can head over to Apple’s website where it has sample code for the new PencilKit APIs.