MVVM is BAD for SwiftUI - Use MVC Instead! (Yes, MVC)

preview_player
Показать описание
MVVM is BAD for SwiftUI - Use MVC Instead! (Yes, MVC)

In this video, I'm going to convince you that using MVVM is a bad idea for SwiftUI - and that you should instead use MVC!

MVVM is a popular design pattern for building UIs with Swift, but in this video I'll show you why MVC is a better solution for SwiftUI. I'll cover the benefits of using MVC for your SwiftUI applications, as well as some best practices for using MVC in your SwiftUI projects. So if you're looking for a better way to build your SwiftUI applications, then you should watch this video!

00:00 INTRO
00:20 MVC: MODEL - VIEW - CONTROLLER
01:01 WHAT IS MVVM
02:45 MENTORING
03:20 MODEL AND VIEWMODEL IN MVVM
07:09 WHY MVVM IS BAD FOR SWIFTUI
08:29 MVC IN SWIFTUI
12:55 WHERE TO GO FROM HERE

→ PLAYLIST:

DO YOU WANT TO ME TO WORK ON YOUR PROJECT?

TOOLS I RECOMMEND:
__________
Get in touch:

SUBSCRIBE to weekly tips & tutorials for building iOS apps!

______
#rebeloper
Рекомендации по теме
Комментарии
Автор

Thanks for the video. However, you only renamed VM to Controller and moved it in root view. The only point of this video was only a renaming!

imamad
Автор

so if UserController was renamed UserViewModel how is that any different than MVVM?

MaccabeeCaptain
Автор

Thanks for your videos. There is a big But here. If you define a Controller (ViewModel) as an Environment object, it will always exist in memory. while when you are creating views and mentioning a ViewModel as @StateObject (you add @State, which is wrong for defining a ViewModel or controllers), it will be deinitialized when the view is destroyed. So for enterprise projects, it is a very bad way to create Controllers(ViewModels) as an environment object.

sajjadsarkoobi
Автор

I think people are already using mvc like when passing data through screens we initialise in the main file and pass it as environment .

Soleusgaming
Автор

Correct me if I'm wrong, but it's an easier way to Composition Root?

I do it in UIKit creating factories in the AppDelegate, it's the same effect?

casadogaspar
Автор

Hi, like you explanation, sure you are going to receive a lot of comments regarding the importance of MVVM because for large projects, and stuff like that. At the end I really support your comments regarding that no problem in put Business logic in the View, because at the end the MMVM file it has to be related to the view so not difference. You approach to use MVC is great.

jcpazos