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.
MVP example
- [Instructor] Now let's take a look at an example. We're going to refactor an App from MVC to MVP. I create a new IOS App based on the master detail App tablet. Let's call it simply: Master Detail. And I'm gonna save it in the working projects directory. The App consists of a master view controller. The master view controller inherits from the UI Table View Controller. We also have a detail view controller, a sub-class of UI View Controller. The tablet comes with a minimum functionality. Let's build and run it by tapping the plus button, we can add new day time entries to the master view. Clicking on the roll, reveals the detail view controller that displays the given date and time. Now, let's take a look at the generated master view controller. There is a lot of code here. The objects class property is actually our model. The View Did Load delegate method, instantiates a UI bar button item. This button is added to the navigation bar. Upon tapping this button, the insert new object…
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
-
-
-
-
-
-
-