Mastering Mvvm With Swift: Updated For Xcode 9 And Swift 4

Mastering Mvvm With Swift: Updated For Xcode 9 And Swift 4
by Bart Jacobs / / / Kindle


Read Online 7.2 MB Download


“I don’t feel in control of my project’s architecture.” - You “MVC simply doesn’t cut it. There must be a better solution.” - Yours Truly Despite its widespread, the Model-View-Controller pattern just doesn't cut it for most Swift projects. Take control of your Swift projects with the Model-View-ViewModel pattern. Massive View Controller Syndrome 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 view controllers. They take on responsibilities they didn’t sign up for. 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? And why is it frustrating or downright scary to add features or refactor existing functionality? It’s Time to Cure MVC 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. MVVM extends MVC 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? Take Control of Your Project With MVVM In Mastering MVVM With Swift, we refactor an existing application built with MVC to use MVVM instead. The results are dramatic and the MVVM 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 and protocol-oriented programming to the mix to further simplify the view controllers in the project. At the end of this course, you have the knowledge and, more importantly, the hands-on experience to apply Model-View-ViewModel in your own projects.

views: 797