Firing up Xcode and starting a new project is a great feeling. The first few days or weeks don't feel like work. Everything goes according to plan.
But as the code base of your project grows, it becomes harder and harder to manage the project. The view controllers of your project start to put on weight ... a lot of weight. They become more than the view controllers. Don't they?
Yet you've done everything right. You've stuck to the rules of the Model-View-Controller pattern. Why have you coded yourself in a corner? Why is it frustrating or downright scary to add new features or refactor classes?
If your project is suffering from Massive View Controller syndrome, then the Model-View-ViewModel pattern is the cure to your problem. The Model-View-ViewModel pattern has been around for many, many years, but it only recently gained traction in the Cocoa community.
The MVVM pattern extends the MVC pattern by resolving common issues. The result is a robust application architecture with lean view controllers, improved testability, and a better separation of concerns. How does that sound?
My name is Bart and I'm the founder of Code Foundry, a mobile development company. I've been teaching since 2004 and I currently focus primarily on teaching developers how to create robust, scalable applications for Apple's platforms using Swift and the Cocoa frameworks. I'm crazy about film music and I have a soft spot for tea and coffee. I'm currently weaned off coffee, but we'll see how long that lasts.
In Mastering Model-View-ViewModel With Swift 3, we refactor an existing application from Model-View-Controller to Model-View-ViewModel. The results are dramatic and the pattern is surprisingly easy to adopt in your own projects.
You learn the differences between Model-View-Controller and Model-View-ViewModel, highlighting the benefits Model-View-ViewModel has over Model-View-Controller.
After a short introduction, we take an application built with Model-View-Controller and refactor it to use Model-View-ViewModel instead. Along the way, you learn about the anatomy of view models, how to create them, and how to test them.
Last but not least, we add protocols to the mix to further simplify the view controllers in the project.
At the end of this course, you have the knowledge and hands-on experience to apply Model-View-ViewModel in your own projects.
"A big thank you. This has been the single most effective course I've taken about iOS. I put it into practice right away and our App Store app, and its testing, has benefited greatly."
- Jake Young, Chief Information Officer
You already have experience building applications using Swift and Xcode, but you're not happy or fed up with the MVC pattern.
You know it's time to step up your game. It's time to move beyond the Model-View-Controller pattern.
Your goal is to build robust, scalable applications for Apple's platforms using Swift.
You don't want to plough through countless tutorials—most of which are out of date—that only show you partial implementations.