Mark DiFranco adds an assembler to the sample project. Then, learn how to apply each Assembly in order to build the object graph. Once that is done, learn how to use the Assembler to resolve a class by asking for the user's permission to use their location.
- [Instructor] Now that we have assemblies defined…for all of our classes, need to assemble them together…with an assembler.…We can close the location group and create a new file…for our main assembler.…Choose Swift file and we'll name it MainAssembler.…Right below the import foundation…we'll add an import for Swinject.…We'll define a single class and we'll call it MainAssembler.…
Now, we can define an assembler to do the assembling.…We use the default constructor…and we'll make sure that we set this as private…so that nobody modify it.…In the constructor for our MainAssembler,…we'll apply each assembly to this assembler.…So we use the apply assembly function…and we'll specify each one of our assemblies,…creating a new instance of each.…
Finally, let's add a property for the resolver.…This will allow us to access the resolver easily…outside of this class.…We'll just return the assembler's resolver.…Let's head over to our AppDelegate.…We'll have our AppDelegate hold on to our MainAssembler.…The AppDelegate is instantiated when our app is launched,…
- Why write unit tests?
- What is dependency injection?
- Using protocols to help with tests
- Handling external dependencies
- Anatomy of a test case
- Writing tests
- Analyzing code coverage
- Visualizing test results
- Writing and extending UI tests
Skill Level Intermediate
Core Data for iOS and macOS Enterprise Developerswith Jon Bott1h 46m Intermediate
Learning Server-Side Swift with Vaporwith Ron Buencamino1h 30m Intermediate
Swift 3 Essential Training: Beyond the Basicswith Scott Gardner2h 58m Intermediate
1. Dependency Injection
2. Using Protocols
3. Writing Tests
4. UI Tests
- 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.Cancel
Take 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.