Post

Replies

Boosts

Views

Activity

Reply to Stop using MVVM for SwiftUI
@Appeloper I know that this is a pretty old thread. But this is interesting. So basically a Store is just an observed Repository then? It's not even a VM. Because a VM is also handling the state of a view such as error handling when the fetching / updating the model (ie. should we display a Toast or Alert or a fullscreen View, what error message to show, the color scheme, the callback when the alert or view is closed, etc). Or when to display or hide activity indicator. Etc. A VM is per view controller / feature while from what I've seen so far, a Store is just per model. So where do you put these other logics? On the corresponding Views? So that means the Views will hold both the layout logic and some business logic? CMIIW.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’25
Reply to Stop using MVVM for SwiftUI
@Appeloper I know that this is a pretty old thread. But this is interesting. So basically a Store is just an observed Repository then? It's not even a VM. Because a VM is also handling the state of a view such as error handling when the fetching / updating the model (ie. should we display a Toast or Alert or a fullscreen View, what error message to show, the color scheme, the callback when the alert or view is closed, etc). Or when to display or hide activity indicator. Etc. A VM is per view controller / feature while from what I've seen so far, a Store is just per model. So where do you put these other logics? On the corresponding Views? So that means the Views will hold both the layout logic and some business logic? CMIIW.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’25