I'm new to iOS development. I need to inject my UIViewController
with injected dependencies and services rather than creating them inside init()
or viewDidLoad()
methods. Something to look like this:
// Initialize View Controller
let viewController = ViewController()
// Configure View Controller
viewController.requestManager = RequestManager()
My questions are:
- Is that possible in iOS or not ?
- Where do I create the dependencies and UIViewControllers ??
- How
MyUIViewController
does look like, should I useinit()
method ?
Note 1: I don't to use any kind of containers. I need to use pure man DI.
Note 2: What am talking about looks like IControllerFactory
in ASP.NET MVC.