Mastering MVVM With Swift: Updated for Xcode 9 and Swift 4, 2nd Edition Front Cover

Mastering MVVM With Swift: Updated for Xcode 9 and Swift 4, 2nd Edition

  • Length: 244 pages
  • Edition: 2
  • Publication Date: 2017-07-17
  • ISBN-10: B0741B1XD1
Description

“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.

Ready for Xcode 9 and Swift 4

In Mastering MVVM With Swift, you learn everything you need to know to integrate MVVM in a new or an existing Swift project. We focus on the key aspects of the pattern and refactor an application that takes advantage of the core features of MVVM. We use the latest and greatest to build an application, which means we use Xcode 9 and Swift 4.

Battling Massive View Controller Syndrome

Are the view controllers of your projects suffering from Massive View Controller syndrome? You’ve carefully crafted the architecture of your application using the Model-View-Controller pattern and, yet, the view controllers of your project are ready to burst and they’re impossible to test.

Adding a feature forces you to wade through hundreds of lines of code. You hope you don’t break anything while you carefully add a few lines of code. Don’t get me wrong. Your code isn’t bad. But there’s just so much of it. You’ve applied the Model-View-Controller pattern like you were told to and you still end up with an architecture you aren’t quite happy with. Does this sound familiar?

It’s Not You. It’s MVC.

Because Apple’s frameworks are impregnated with the Model-View-Controller pattern we think it’s the right or only tool for the job. Don’t make the same mistake. There’s nothing wrong with the Model-View-Controller pattern, but there are better alternatives, especially if you’re using Swift.

Table of Contents

Chapter 1 Is Mvc Dead
Chapter 2 How Does Mvvm Work
Chapter 3 Meet Cloudy
Chapter 4 What Is Wrong With Cloudy
Chapter 5 A Quick Recap
Chapter 6 Time To Create A View Model
Chapter 7 Put The View Model To Work
Chapter 8 Rinse And Repeat
Chapter 9 Using Mvvm In The Settings View
Chapter 10 Adding Protocols To The Mix
Chapter 11 Making Table View Cells Autoconfigurable
Chapter 12 Supercharging Mvvm With Protocols
Chapter 13 Ready, Set, Test
Chapter 14 Testing Your First View Model
Chapter 15 Using Stubs For Better Unit Tests
Chapter 16 A Few More Unit Tests
Chapter 17 Taking Mvvm To The Next Level
Chapter 18 What Are The Options
Chapter 19 Diy Bindings
Chapter 20 Why Rxswift
Chapter 21 Integrating Rxswift And Rxcocoa
Chapter 22 Refactoring The View Model
Chapter 23 Refactoring The View Controller
Chapter 24 Protocol Oriented Programming And Dependency Injection
Chapter 25 Testing And Mocking
Chapter 26 Where To Go From Here

To access the link, solve the captcha.
Subscribe