Chris the iOSDev @ilea.dev · Dec 8

(3) Now, answering your SwiftUI question. Let's look at this code. You’re looking at a subtlety stemming from how SwiftUI reconstructs and re-invokes your view’s body every time the underlying state changes.

0 likes 1 replies

?

Replies

Chris the iOSDev · Dec 8

(4) Even though myVar is defined as a let constant within MyView, that doesn’t mean it’s truly constant from the perspective of the entire application. Each time Container changes myInt, it effectively creates a “new” MyView instance with a different myVar.