I just discovered that PKDrawing now lists the same method .draw(in: , frame:) also as asynchronous drawing code. This will only work as of iOS 26 and up.
I wonder if this is going to be the way forward for CGContext drawing code, and if so, how should we treat the block drawing in an async closure.
Take this example from WWDC25 Meet Paperkit:
// Set up CGContext to render thumbnail in
let thumbnailSize = CGSize(width: 200, height: 200)
let context = makeCGContext(size: thumbnailSize)
context.setFillColor(gray: 1, alpha: 1)
context.fill(renderer.format.bounds)
// Render the PaperKit markup
await markupModel.draw(in: context, frame: CGRect(origin: .zero, size: thumbnailSize))
thumbnail = context.makeImage()
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: