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 | More toots from comex@mas.to
@comex I'm very curious what you're doing with said properties, while what you're describing is of course true, neither sounds like a very common pattern
=> More informations about this toot | More toots from kylebshr@mastodon.social
@kylebshr Well, the first one is, I believe, effectively what happens when you use ObservedObject in a SwiftUI View.
But it's deprecated, I know.
=> More informations about this toot | More toots from comex@mas.to This content has been proxied by September (ba2dc).Proxy Information
text/gemini