When you're investigating iOS development, early on you will run into discussions about iOS app architectures, and start getting hit with a wall of acronyms and jargon: MVC, MVVM, MVP, VIPER, RIBS, Clean, RxSwift, ReactiveCocoa, and even more. You will also find heated discussions online where developers sing the praises of the architecture of their choice, whether it is the more modern patterns such as MVVM or VIPER, or the tried and true MVC.
With all of these choices and all of these opinions, you will quickly ask the question: which one do I start with?
While many of the other architectures are newer, and can solve some of the problems of iOS development (when done correctly), there is really only one answer to the question which one you should start with: MVC.
The reason to start with MVC, or Model-View-Controller, is that it is a mature architecture, not just in iOS development, but software development in general. Apple built UIKit with the MVC pattern in mind: Using UIViews for the View, and UIViewControllers for the Controller (Model is a subject for another article, the iOS SDK provides much less guidance for that area).
The benefits of MVC being the Apple-approved™️ pattern for app development are several:
- Apple provides plenty of first-party documentation for this pattern, and because it is baked into the SDK, so have many other developers and teachers.
- You are not dealing with the double difficulty of learning app development AND learning a less common iOS app architecture.
- Because MVC is baked into the iOS SDK, there is less variance in how developers implement that architecture in code. Other architectures have developed in a more ad-hoc manner, and the way each developer uses them has more variability.
- Many of the alternate patterns are based off of MVC, as they were engineered to fix some of the perceived shortcomings of MVC.
- There is an expectation that an iOS developer would understand and know how to implement an app using MVC, given it is the default architecture for the iOS platform.
Over time, you will probably end up learning most, if not all, of these app architectures, because some of them can be better suited for certain types of applications. When you are just starting out, or trying to figure out which of these patterns you should understand the best, learning the pattern that is baked into the platform is going to be the best choice.
Did you like this tip? The next tip on stopping commits to constantly changing files in Xcode with a gitignore is already waiting for you. Or sign up to get every tip straight to your inbox.
This post originally published at Apps Dissected.