SwiftUI MVVM | A Realistic Example

preview_player
Показать описание
Kilo Loco goes over a simple example of how to use MVVM (Model View ViewModel) with SwiftUI. He will cover strategies to keep code consistent, dependency injection of service models, and unit testing.

*** Show Notes and Links ***

Project Files:

Kilo Loco on Social Media:

#swiftui #iosdev #mvvm
Рекомендации по теме
Комментарии
Автор

Bro. After watching this, I feel like I owe you money now. Definitely helped a lot. 🔥

HatTerry
Автор

this kind of realistic senarios are the best, please feed us more Loco ! good luck

ghazitozri
Автор

nice tutorial. straight to the point, no beating around the bush, no 5 minutes of talking randomness and then 20 minutes into the video reiterating that just to make the video a certain length 😂

again thanks for the quick explanation!

pqsk
Автор

This is great. I'd love to see various example of MVVM with real-world examples of a backend, whether through networking or some sort of persistence manager (I'm thinking Codable, Core Data, etc.) I'd also love a more clear explanation of how to Combine with MVVM in a more powerful way than what was done in this video. Thanks!

huntermeyer
Автор

Kilo's recent postings exude the kind of confidence and completeness I appreciate when trying to learn/use SwiftUI in the real world. His comments especially give you the kind of insight you need when considering completeness (lifecycle). Production is topnotch as well, no more fumbling over errors or mistyping.

talldane
Автор

Nice, I like the idea of using an extension to wrap the view model. Never seen that before but makes alot of sense to me.

Skolzerx
Автор

Great video!
Whenever a project starts to get bigger a problem that I have is on how to organize the architecture and the folder structure, it would be nice to see how you do it, maybe in a real project or something like that!

FredLacis
Автор

This video was absolutely perfect. Dependency injection with default values, protocols & mocking is how I work right now with UIKit, and your video was perfect for teaching me how to work the same way with SwiftUI. Loved it.

ssturge
Автор

Op! Did I just find my new favorite YouTube?

marshallross
Автор

best video i watched this year lad good job

lamehunter
Автор

I am so happy to see another video of you again

franciscojavierpriorramos
Автор

This is the thing we need “real world scenario”. Implementing MVVM and it works, adding a network delay and the preview stops working. Thanks for putting this out! Data flow in this design pattern is a point of interest. A common scenario should be a settings view that changes a app-wide setting which another view has to notice.

christianschuster
Автор

Very clear explanation and example. Thank you!

danlkramer
Автор

Thanks! You’re a great teacher! I really appreciate how you specifically called out how to get things working in previews and how to make it testable,

larryogrodnek
Автор

Great video. I'd like to see an example where we need to pass the 'Users' from view to view, where each of those views have their own ViewModel. I don't want to be 'fetching' my data each time I initialise a new ViewModel. Thanks :)

podomunro
Автор

Good video! Clean and to the point. Def helps with transitioning from thinking of UIKit MVVM to SwiftUI MVVM.

thugcow
Автор

Thanks for the content. I saw your other protocol videos but I'm not quite understanding the benefit of introducing protocol here. Could you kindly elaborate on the following??

"It also gives us the flexibility to start testing with like a MockDataService or whatever you want to do there and all this functionality will still work" (11:19)

hirokiishida
Автор

Thanks for this tutorial. It's easier to understand and the pace is spot on. I've been using state based MVVM in UIKit and was wondering how I can use it in SwiftUI.

jeraldo
Автор

I would really really appreciate a session exactly like this but with DataStore as the main source of data. You mentioned using "data managers" instead of a DataService; is this what you meant? DataStore is a singleton though isn't it? It is sort of available via injection, not via @Environment but via 'import Amplify'. Perhaps I need to learn more about Combine but how would you extract the DataStore.hub.publisher call into a separate DataService class? Can you 'mock' DataStore.hub or should GraphQL calls to it be encapsulated in a DataService for testing the ViewModel?

_WhatsInAName_
Автор

Great explanation, would be great to see a tutorial of MVVM + CoreData

luism