Member-only story
Implementing SwiftUI Canvas in iOS 15
A look at using the new Canvas view in SwiftUI

Unfortunately, SwiftUI remains a little unfinished — at least compared to its big brother UIKit. Even though it is in its third revision with iOS15, it is still missing some important views.
I feel, one of the main challenges remaining for Apple is being how to make the transition as painless as possible. Nobody wants to rewrite UI/UX code — companies certainly can’t afford to. They need a way to reuse as much of the code they already have, but without the UIKit baggage that comes with it.
Besides that, SwiftUI is a very new paradigm, tweaking some controls which developers had previously mastered. So although they didn’t say as much in their recent WWDC 21 presentation on the subject Apple is trying in my view cover some middle ground here. Middle ground with a new view called Canvas. A compromise in some ways.
It was presented at the WWDC 21 as a more efficient way to do drawings. It may well be more efficient in terms of CPU, but watching it I couldn’t help but think it is more efficient too in terms of code migration, supporting Core Graphics primitives natively, something you could not do in SwiftUI before so easily — it was a little painful with the need to convert between UIImages
and Images
.