I'm trying to create an app which will switch programmatically from a View Controller to another. I've already tried to do that with this code:
let secondViewController = self.storyboard?.instantiateViewController(withIdentifier: "EndViwController") as! EndViewController
self.navigationController?.pushViewController(EndViewController, animated: true)
But it turns me this error:
[Cannot convert value of type 'EndViewController.Type' to expected argument type 'UIViewController']
Also, when I try this other code:
let timeLineTableVC = EndViewController()
self.present(timeLineTableVC, animated: true, completion: nil)
It gives to me a black screen on the simulator and the EndViewController doesn't appear.
In the end, when I try this:
let storyboard = UIStoryboard(name: "EndViewController", bundle: nil)
let controller = storyboard.instantiateViewController(withIdentifier: "EndViewController")
self.present(controller, animated: true, completion: nil)
It gives me this error:
[libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)]