Summary
In conclusion, you should now be able to understand when it makes sense to use the MVVM pattern, and its advantages and limitations over the more native MVC pattern.
We also quickly covered the use of two-way data binding, and how this technique, borrowed from the Reactive world, can help you to bind view models to their views simply and effectively.
Note
Architectural patterns are not a one-size-fits-all solution. It is appropriate and actually encouraged, to leverage the right solutions for the right problems. Always be mindful when adopting a pattern, as each has its benefits and drawbacks.
We can compare the MVVM philosophy to the dependency injection technique. In this technique, the elements that are required for an object or function to perform a particular task (in the MVVM, it would be the view model) are provided at runtime. We'll jump into the specifics of dependency injection in Swift in the next chapter.