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.
Implementing one-way binding, part 2
From the course: iOS Development: Architecture
Implementing one-way binding, part 2
- [Instructor] Now let's switch to the view model class. I need to change the type of the my model property from model date to model observable date. We need now to refactor the add entry method. First I create a constant named date observable. Which is an observable instance that takes a value of type date. And, I paste this to the my model insert method. Next we have to assign our closure to the bind property. Whenever the observed value changes, this closure gets involved. I'm going to update the table view to show the new value. Since we can't access the table view directly we'll be firing a notification. I'm going to rely on notification center and we'll post a dedicated notification. I have to provide the notification name as a raw value. Alright? Next we need to listen to this notification in the master view controller. I readjusted the view model notification in the view did load delegate method. We'll add an observer. We need the very end which has a completion block, this…
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
-
-
-
-
-
-
-