My mistake - indeed ObservableObject is part of Combine, it's only ObservedObject that's part of SwiftUI.
However, this is still two ways to use Combine to observe a class with multiple properties. Either way you need @Published on the properties. But you can then either
(a) use @ObservableObject to get notified when any property on the object will change, then re-read all the properties in a callback; or
(b) subscribe directly to the property Publishers.
https://mastodon.social/@nicklockwood/113584010733609754
=> More informations about this toot | View the thread | More toots from comex@mas.to
text/gemini
This content has been proxied by September (ba2dc).