Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2020 SwiftUI & UI Frameworks

WWDC20 · 10 min · SwiftUI & UI Frameworks

What’s new in PencilKit

PencilKit helps power creativity, writing, drawing, and animation in your iPad apps. Explore the latest improvements to our drawing and annotation framework, and discover how you can take advantage of APIs like PKToolPicker, PKCanvasView, and PKStroke to support new features in illustration and writing apps. To get the most out of this session, you should have a basic understanding of PencilKit. If you want to a refresher, “Introduction to PencilKit” from WWDC19 is a great place to start.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 3 snippets

PKCanvasView drawingPolicy swift · at 5:21 ↗
var drawingPolicy: PKCanvasViewDrawingPolicy
PKToolPicker showDrawingPolicyControls swift · at 7:06 ↗
PKToolPicker.showsDrawingPolicyControls
Toolpicker per canvas swift · at 8:40 ↗
notesCanvas.drawingPolicy = .default
notesToolPicker.showsDrawingPolicyControls = true
notesToolPicker.selectedTool = PKInkingTool(.pen, color: .black, width: 2)

drawingCanvas.drawingPolicy = .anyInput
drawingToolPicker.showsDrawingPolicyControls = false
drawingToolPicker.selectedTool = PKInkingTool(.marker, color: .purple, width: 20)

Resources