Open elprl opened 5 years ago
Or a suggestion here on how to do it?
For others wondering about this, I ended up adding the following extension:
extension ModuleProtocol {
func presentWithNavController(from fromVC: UIViewController?, style: UIModalTransitionStyle, completion: CodeBlock? = nil) {
let navVC = UINavigationController(rootViewController: viewController)
navVC.modalTransitionStyle = style
fromVC?.present(navVC, animated: true, completion: completion)
}
func replaceRoot(from navController: UINavigationController?) {
guard let navvy = navController else { return }
var vcs = navvy.viewControllers
vcs[vcs.count - 1] = viewController
navvy.setViewControllers(vcs, animated: true)
}
}
Which can then be used as follows:
ProductDetailedModule().presentWithNavController(from: viewController, style: .coverVertical)
@elprl - Thanks for reaching out! I'll do my best to resolve this asap.
For now, I'm open to pull requests.
Could the example project be updated with a use case for modules in UINavigationControllers and UITabBarControllers? Also, will you be doing a Swift 4.2 update?