In AppKit/UIKit, when I get an object from a REST API I decode it, modify it, and then push the modified object back.
REST ➡️ decodedObject ➡️ decodedObject.foo = true ➡️ REST
I struggle to keep it as simple with #SwiftUI!
Let’s say I want to use a Toggle to flip decodedObject.foo, I can't because it expects a Binding, so I end up with
REST ➡️ decodedObject ➡️ .onLoad { (@ State var) fooCopy = decodedObject.foo ➡️ Toggle(isOn: $fooCopy) } ➡️ .onDisappear { decodedObject.foo = fooCopy } ➡️ REST
