Michael Long
Sep 12, 2022

--

Just keep in mind that using _printChanges inside of a view body doesn't necessarily mean that view is being rendered. It's being evaluated to see if it or it's subviews should be rendered. A critical distinction.

Also it's not just properties. Using an if or switch in a view body that alters the structure of the view tree will also trigger a redraw.

The WWDC Demystify SwiftUI talk goes into this a lot further.

https://developer.apple.com/videos/play/wwdc2021/10022

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)