This was really useful! I'm picking up some SwiftUI as a front-end web developer and this feels just like how the new JS frameworks are being built for Single Page Apps. I use Services, Stores and etc in my Vue.js apps. Would be great to see how you would create a CRUD application
Thank you Mohammad for the video. There is a problem however, data flow is only going one way - from the Model to the View. This isn’t a problem for hobby apps like the ones apple uses for demonstration but for the more complex apps this one way flow becomes a huge problem. I really don’t understand why you won’t show CRUD functionality with this pattern. If you have already demonstrated this I kindly ask that you present the link to the video. I really wish the MV pattern was as useful as you advertise because it would make my life much easier. However I think you are trading in functionality for simplicity.
Why did you create two instances of Store, one in ContentView and one in its child MovieDetailView? Wouldn't that mean you duplicated the stores and have two sources of truth?
Just watched the whole video and I don't see where he created 2 instances of the store? (new to learning SwiftUI and looking for clarification on what was wrong here)
Just a small mistake that MovieDetailView should be supplied the existing Store as an @ObservedObject rather creating its own instance as @StateObject. An improvement to the Store would be to have an array of MovieDetail so you don't need to do a web request if the same movie is navigated to twice.
This was really useful! I'm picking up some SwiftUI as a front-end web developer and this feels just like how the new JS frameworks are being built for Single Page Apps. I use Services, Stores and etc in my Vue.js apps. Would be great to see how you would create a CRUD application
Thank you Mohammad for the video. There is a problem however, data flow is only going one way - from the Model to the View. This isn’t a problem for hobby apps like the ones apple uses for demonstration but for the more complex apps this one way flow becomes a huge problem. I really don’t understand why you won’t show CRUD functionality with this pattern. If you have already demonstrated this I kindly ask that you present the link to the video. I really wish the MV pattern was as useful as you advertise because it would make my life much easier. However I think you are trading in functionality for simplicity.
@azamsharp , can you please elaborate on this?
Here is a link to my BudgetApp which uses Core Data.
github.com/azamsharp/BudgetApp
Also check out my article here:
azamsharp.com/2022/08/09/intro-to-mv-state-pattern.html
BudgetApp (Core Data):
github.com/azamsharp/BudgetApp
Why did you create two instances of Store, one in ContentView and one in its child MovieDetailView? Wouldn't that mean you duplicated the stores and have two sources of truth?
Just watched the whole video and I don't see where he created 2 instances of the store? (new to learning SwiftUI and looking for clarification on what was wrong here)
@@scriptedpixelsltd Could you show that they are the same store? (Looking for clarification too)
Thanks❤
Just a small mistake that MovieDetailView should be supplied the existing Store as an @ObservedObject rather creating its own instance as @StateObject. An improvement to the Store would be to have an array of MovieDetail so you don't need to do a web request if the same movie is navigated to twice.
That was simple example. You can add caching layer if you want
Wondering what back porting this to iOS 15 would look like? (Xcode 14 Beta is still NEW)
You should be able to use Xcode 13 for this example too.
Nice