Stale view update in `willSet` (Observation & SwiftUI)?
Swift Forums
Stale view update in `willSet` (Observation & SwiftUI)?
I have encountered a synchronization issue while developing my iOS app where two parts of a SwiftUI view graph disagree on the same @MainActor @Observable view model state. Imagine two views that access currentValue in their bodies. One shows currentValue, and the other shows newValue after running this line of view model code: self.currentValue = newValue After manually expanding the @ObservationTracked macro and adding let _ = Self._printChanges() to the relevant view bodies, it became clear...
0 comments
No comments yet.