Good I'm doing the test of having two view_controller
one called Main
and another view_2
, in each one there is a button and that serves as a navigation between them, but I fail to return.
In the first view controller
, called main
I have this code:
@IBAction func button_1(sender: AnyObject) {
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let ViewControllerDos = storyBoard.instantiateViewControllerWithIdentifier("view_2")
self.presentViewController(ViewControllerDos, animated: true, completion: nil)
}
And in second view controller
, called view_2
I have this:
@IBAction func button_2(sender: AnyObject) {
let storyBoard1 : UIStoryboard = UIStoryboard(name: "view_2", bundle: nil)
let ViewControllerDos1 = storyBoard1.instantiateViewControllerWithIdentifier("Main")
self.presentViewController(ViewControllerDos1, animated: true, completion: nil)
}
But I get an error when I press the button in the second, what am I doing wrong?
Thank you.