'How to initialize view controller of a container view with viper design pattern in swift?
I want to initialize a view controller of a container view with VIPER design pattern and I tried to use addChild() function but it didn't work so anyone can help?
let homeVC = Storyboard.Main.viewController(HomeViewController.self)
let homeConfigurator = HomeConfigurator()
homeConfigurator.configure(HomeViewController: homeVC)
let listVC = Storyboard.Main.viewController(ListViewController.self)
let listConfigurator = ListConfigurator()
listConfigurator.configure(ListViewController: listVC)
homeVC.addChild(listVC)
listVC.didMove(toParent: homeVC)
let homeNavigationController = HomeNavigationController(rootViewController: homeVC)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
