Mark DiFranco introduces the open source dependency injection framework, Swinject. Learn how to use Swinject's container class as a DI container with a quick example. Then, learn how using Assemblies and an Assembler can help keep your project organized. Finally, you'll create a new Xcode project, and link the frameworks.
- [Instructor] Swinject is a dependency injection framework…written in Swift.…The project is open sourced on GitHub,…and is what we'll be using to implement…our dependency injection in our project.…Swinject offers nice features,…such as object scoping,…as well as a few useful tools…for organizing our project.…We'll also be using the SwinjectStoryboard framework…to help us inject into our storyboard view controllers.…There are a few other…dependency injection frameworks available,…but we use Swinject because of its useful features,…and its compatibility with storyboards.…
Let's take a conceptual look at Swinject's components,…and how they can help us.…Container's are Swinject's names for DI containers.…We can register classes with it,…and resolve classes to instantiate them.…Here we can see we have a container class,…and we're registering a URL session on the second line,…and a URL cache on the third line.…Below that, we have a registration…for the photo downloader.…The block is passed in a resolver,…which we can use to resolve the URL session…
- 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
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.