ObservableObject
ObservableObject is a protocol in the Swift programming language, primarily used within the SwiftUI framework, designed to facilitate data binding and dependency management. It allows objects to be observed for changes, enabling other parts of an application to react automatically when their state is modified.
To implement ObservableObject, a class must conform to the protocol and be marked with the @objcMembers attribute
This mechanism is fundamental to SwiftUI's declarative UI paradigm. Views in SwiftUI can subscribe to changes
When a published property of an ObservableObject changes, any view observing it will be re-rendered to reflect