If you are a professional iOS or Android developer and you explicitly manifest your love for MVC as base architecture for your Apps, you are a leper and would be ostracized.
Nowadays the MVC is frowned upon and not in the favor of altruistic developers.
Viper, React, MVVM, those are good, MVC is bad and crappy…
Truth or myth?
Well, MVC is old indeed and certainty it got its flaws, most common of all, the feared “massive view controllers”.
But although the new aforementioned architectures bring to the table some solutions to MVC intrinsic issues, they do have some flaws as well, yeah “nobody is perfect”.
MVC is great, programmers are just too careless.
In this article, I will suggest a couple of generic advices that will make, without too much pain, your MVC App fresher and unpolluted:
1. Move out the ViewController all the Network handling.
Simple as it sounds, make yourself a NetworkManager class and strip all that’s network related out of the ViewController, automatically you would end up with a lighter ViewController.
2. Move out the ViewController all the data/view parsing.
This could be a bit more complex depending on your view hierarchy, but basically don’t go parsing dates, currencies, name syntaxes etc., within your view controller.
If you have a ViewController that displays a person profile detail, it’s better to create a struct or a container class aside that would handle all the text and image engineering. For example, a PersonView struct. (This is the bedrock of the MVVM paradigm, sort of).
Afterwards the ViewController should be limited only to assign the properties of that container class to the outlets.
Again, an easy way to clean your ViewControllers and make them neater.
It’s OK for the ViewController to handle the view interactions… (For now).
Disagree? Just comment…