The design mode is not dead. It is necessary to make some changes according to your own needs and understanding, and any change is inevitable. The MVC used in the current project is actually slimming down the Controller. The image above is taken from the iOS Architecture Patterns, and HERE I’ll go straight to my implementation.
I’m going to break it down by module and I’m going to create MVC folders in the module directory, I don’t like big MVC file directories and I’m going to put the relevant classes in that folder.
I’m not going to write code like addSunViews in the Controller, so it’s all wrapped in the View, the Storyboard. I put the storyboard in the Controller out of personal habit, which I personally think belongs to the View
The Controller contains Request and C->V value passing classes. In the actual project, part of the business logic code is placed in the ViewModel (the ViewModel is not the same as the MVVM, just a few ideas).
In fact, MVVM and MVP can and do solve the problem of C being too bloated. So why not use the popular MVVM, because the implementation of MVVM is dependent on RX and RAC, and they are not used in major projects so MVVM was not directly introduced (this is a really far-fetched excuse). “, and suggested that all third-party libraries had better be encapsulated by themselves, otherwise they will leave tears of regret when changing libraries.
Git addressgo go
Thanks for watching, here is my understanding of MVC in the project, I hope to make more corrections