Learn how to use Swinject's assemblies in the sample project to keep things organized. Mark DiFranco also introduces object scopes, and explains how they can help when building an app.
- [Instructor] We've just created all of the business logic…for our app,…let's take a look at how Swinject…can help us link it altogether.…To start, we'll create assemblies for each of our classes.…Remember an assembly is an object that helps facilitate…the registration of our classes.…Once we have the assemblies defined…we can link them altogether using an assembler.…We can use our app delegate to keep a reference…to the assembler.…When registering our classes in the container…we should make sure to use the correct object scope.…In Swinject the object scope determines the lifetime…of a registered class when it is resolved.…
This table covers the different object scopes…available in Swinject.…The first object scope is transient.…This object scope means that Swinject will create…a new instance every single time the class is resolved.…The next object scope is container.…This is a singleton so when Swinject…creates a single instance of this class,…it will share that single instance between other resolvings.…The last object scope is weak.…
- 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
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.