From the course: iOS Development: Architecture
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
The Model-View-ViewModel pattern
From the course: iOS Development: Architecture
The Model-View-ViewModel pattern
- [Narrator] The Model-View-View Model uses the same separation of concerns as the Model-View-Presenter. There are two differences though. The presenter is called view model, but it has the same responsibilities as the presenter. This is just naming. But there's another major difference between the two architectural patterns. MVVM provides two-way data binding. The essence of this feature is how we propagate changes across the layers of our architecture. With data binding, the view and the view model react to model changes automatically, and the model is updated instantly when the user performs relevant changes on the UI. The power of data binding relies in the fact that it requires almost no additional coding. Unfortunately, we don't get data binding for free in iOS, yet there are various ways to implement it using, for example, notifications, key value observing, or delegation. There are also third-party frameworks like Bond, for example. Here's the framework's GitHub page if you…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Introduction to fundamental architectural design patterns57s
-
(Locked)
The model-view-controller3m 50s
-
(Locked)
The model-view-presenter1m 22s
-
(Locked)
MVP example2m 41s
-
(Locked)
Refactoring to MVP: Model2m 26s
-
(Locked)
Refactoring to MVP: Presenter2m 32s
-
(Locked)
Refactoring to MVP: View controller4m 29s
-
(Locked)
The Model-View-ViewModel pattern1m 15s
-
(Locked)
Implementing one-way binding, part 11m 34s
-
(Locked)
Implementing one-way binding, part 23m 55s
-
-
-
-
-
-
-