๐ธdata model
terms โฉ data model
To share the same data between multiple views, you need a single source of truth that is separate from the views. This is the data model, and you can share it with any views that need access to the data.
Your user interface may display data from the data model, and may interact with it to modify the data.
A common way to construct a data model for a SwiftUI app is to use an observable object. an observable object is an object (reference type) that multiple views can observe.
Last updated