Toot

Written by comex on 2024-12-02 at 16:20

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

Mentions

Tags

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113584138448296212
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
224.217654 milliseconds
Gemini-to-HTML Time
0.29078 milliseconds

This content has been proxied by September (ba2dc).