The next step is to look for any instances where we instantiate a dependency. Although you could look for a new instance of an object in Foundation (Strings, Dates, Buttons, etc.) this tends to be over kill. Typically the line is drawn between a class that you make and Foundation classes. We will focus on injection our different layers (View, presenter, Model, Network, Data, Translators).
- [Narrator] So let's continue by first looking at…the app delegate.…And in this app delegate, all we need to do is remove this…shared instance. That's now handled within our dependency…registry, and I'm just going to create a…variable, call it dependencyRegistry,…and remember that this variable is…instantiated within our whole SwinjectStoryboard process.…And that's all we really need to do here. This variable…will eventually be assigned within that process and the…web server will be initialized. And then, let's start…going through each of our different views and cells and…make sure that things are connected properly.…
So, let's go up into here, into the…creation process of this cell,…and instead of passing in a spy, we're actually just…going to pass in a presenter, cause the…presenter will be created with its properties within…the dependency registry.…So, spyCellPresenter, and we aren't even responsible for…creating it here anymore.…The next thing that we're going to look at is…the spyListPresenter,…and right now we're instantiating…
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: Presenter conversion