ios - Dismissing multiple view controllers showing wrong view during transition -
i have total of 4 uiviewcontrollers. each of views has button when pressed presents next viewcontroller. when button on last uiviewcontroller pressed calls dismissviewcontrolleranimated(true, , completion: nil) on rootviewcontroller. when called shows view #2, instead of staying view #4, transitions view #1. in documentation says when top-most view view animated during dismissing, that's not case me? happens if used segues.
class viewcontroller1: uiviewcontroller { @ibaction func btndidtouch(sender: anyobject) { var viewcontroller = self.storyboard!.instantiateviewcontrollerwithidentifier("viewcontroller2") as! uiviewcontroller self.presentviewcontroller(viewcontroller, animated: true, completion: nil) } } class viewcontroller2: uiviewcontroller { @ibaction func btndidtouch(sender: anyobject) { var viewcontroller = self.storyboard!.instantiateviewcontrollerwithidentifier("viewcontroller3") as! uiviewcontroller self.presentviewcontroller(viewcontroller, animated: true, completion: nil) } } class viewcontroller3: uiviewcontroller { @ibaction func btndidtouch(sender: anyobject) { var viewcontroller = self.storyboard!.instantiateviewcontrollerwithidentifier("viewcontroller4") as! uiviewcontroller self.presentviewcontroller(viewcontroller, animated: true, completion: nil) } } class viewcontroller4: uiviewcontroller { @ibaction func btndidtouch(sender: anyobject) { self.view.window?.rootviewcontroller!.dismissviewcontrolleranimated(true, completion: nil) } }
Comments
Post a Comment