- I've got three ViewControllers - V1 V2 and V3.
- A button click on V1, ViewController V2 is displayed with animation FlipHorizontal.
Now on a button click from V2, ViewController should be dismissed back to V1 and display ViewController V3.
I tried this piece of code to achieve this functionality. It's not working though. Please help!
Note : V2 and V3 are in same StoryBoard (Start). V1 is in different story board(main).
var VC3 : ViewController3?
let mainStoryboard: UIStoryboard = UIStoryboard(name: "start",bundle: nil)
self.dismissViewControllerAnimated(false, completion: {
self.VC3 = (mainStoryboard.instantiateViewControllerWithIdentifier("ViewController3") as! ViewController3)
self.presentViewController(self.VC3!, animated: true, completion: nil)
})
Update- I get this warning Attempt to present ViewController3 on ViewController2 whose view is not in the window hierarchy!