Michael Long
Aug 13, 2024

--

That's not how it works. Published value changes basically sends a "this will need to be updated" message. The cumulation of those messages will be handled on the next runloop when the view data is diffed and then if needed, the view is redrawn.

You can see this by putting a print statement in the view body and the changing those three values.

You'll only get a single view update.

--

--

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)