According to the “Manually publishing ObservableObject changes” post on the Hacking with Swift website (I can’t link it here due to forum restrictions):
As its name implies, this publisher should be triggered immediately before we make our change, which allows SwiftUI to examine the state of our UI and prepare for animation changes.
That makes sense to me. SwiftUI might need to know the old value in some cases in order to perform animations.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: