We apply the Presenter pattern to the Secret Details view. With a few minutes of effort we are successfully isolating the View Layer. Some people argue that architecture takes too long, and takes too much effort, but this part of the process is so quick and easy, and it provides a springboard to a lot of value.
- [Narrator] The next step is to put presenter…in the secret details view.…First let's go over here to the detailed view controller,…create that class for the detail presenter,…and then we'll say new file,…new swift file,…detail presenter,…come back and we'll just cut and paste this class…over to that next one,…and then coming back,…let's expand the secret details…and go into the view controller,…and we'll just make our class at the top again,…class secret details presenter…and in here, I'll say, we're going to have that spy...…
in fact, I'll just cut this line,…and the other property that we're going to be using…is the password on that spy,…so we'll save our password, it's a string,…and we'll just say return spy.password…and then we'll make that a init method again,…and we'll say we're taking in a spy,…and we'll say self.spy is equal to the spy…and then in here, let's just make sure…that we have that presenter,…file private, var presenter,…equals to a secret details presenter,…and we don't even need to…make it implicitly unwraps because we can pass it…
Author
Released
6/27/2017- Moving pieces of architecture
- Designing an MVA app
- Walking through a demo application
- Converting to MVP
- Moving non-view logic to a presenter
- Breaking logic into layers
- Using entities
- Setting up dependency injection
- Implementing the coordination pattern
- Adding data binding with RxSwift
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome48s
-
-
1. Moving Pieces of Architecture
-
Why architecture?3m 32s
-
Architecture pieces2m 19s
-
Common architectures3m 42s
-
-
2. Demo Application Walkthrough
-
UI overview41s
-
Code overview1m 18s
-
Load data2m 51s
-
-
3. Convert to MVP
-
Create presenter3m 14s
-
Create presenter, part 23m 28s
-
Create presenter, part 32m 36s
-
Create presenter, part 43m 21s
-
-
4. Expand Layers
-
Expand layers5m 59s
-
Expand layers, part 24m 14s
-
Entities2m 49s
-
-
5. Dependency Injection
-
Swinject overview6m 27s
-
Swinject storyboard3m 14s
-
Presenter conversion5m 45s
-
Protocol injection8m 53s
-
-
6. Navigation Coordinators
-
Coordinator walkthrough3m 15s
-
-
7. Data Binding
-
RxSwift – observables11m 15s
-
RxCocoa – data binding6m 46s
-
-
Conclusion
-
Next steps42s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Create presenter, part 3