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.

Wire into Swinject and app delegate

Wire into Swinject and app delegate

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

Start my 1-month free trial

Wire into Swinject and app delegate

- [Instructor] The first thing that we need to do to get this navigation coordinator working is add a reference of it to the app delegate. This is going to be pretty easy. We're going to just call it a static var, navigation coordinator. And we're going to make sure it's implicitly unwrapped. So we don't have to initialize it. And then, to make this work, let's go ahead to the Swinject Storyboard. And create that instance. So in here, we're going to make that coordinator. We'll say let coordinator equal to dependency registry. We don't have that method yet. So, we'll just call it make Root Navigation Coordinator. And we'll say root view Controller. It's going to be that vc that's being passed into this method. And in here, we're going to pass it on down to that setup data. Navigation Coordinator. And we'll just pass that in. And in this view controller, we aren't going to need to pass that make method anymore because that's going to be the responsibility of the coordinator. And we are…

Contents