From the course: iOS App Development: Design Patterns for Mobile Architecture

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Swinject overview

Swinject overview

From the course: iOS App Development: Design Patterns for Mobile Architecture

Start my 1-month free trial

Swinject overview

- [Instructor] Now that we've moved our entities out and are using our DTOs, the next step is starting to work with dependency injection, or just injection. In order to do this, you can either roll your own dependency registry, or you get your classes out. Or, with Swift, there's a great project called Swinject. Swinject is an open source project on GitHub and it's mature and still developed. It's a great project if you wish to have a framework managing all of your dependencies. Now, with Swinject, there's a lot of configuration going on, and I think it would better serve your time instead of us typing through it. I've written up a couple of files beforehand and we're going to walk through them. They're included in your project folder. Go ahead and drag this Injection subfolder into your project and put it within its own layer. Just create groups instead of references and click Finish. And we'll name this folder Dependencies. These two files are what Swinject uses to create things…

Contents