I use swinject with swift 3. I try to present on my current view controller, another view controller, located in a .xib file.
if I do it in a project without swinject, it works. in my project, using swinject it crashes : libc++abi.dylib: terminating with uncaught exception of type NSException
here is the code I use to define the view controller :
let container = Container() { c in
c.register(testViewController.self) { r in
let myVC = testViewController(nibName: "testView", bundle: nil)
return myVC
}
}
here is how I try to present the testViewController on my current viewController (on a button click IBAction for example):
self.present(container.resolve(testViewController.self)!, animated: true, completion: nil)
I Tried different solution without success. I cannot remove swinject ( this choice is not mine ), and I believe that it is a good idea, even if I am not easy with it. I need to use .xib file because I have a lot of viewcontroller, to present, at different steps.
thanks for any help. Olivier