uiviewcontroller - Swift popToRoot not working -
this highlighted line should poptoroot proceed, after successful registration should redirect root view controller. reason it's not working me, literally nothing happens, not error.
i tried
self.navigationcontroller?.poptorootviewcontrolleranimated(true)
you don't appear using navigation controller @ all, i'd wager self.navigationcontroller
nil
.
you use unwind segue. in root view controller, add method so:
@ibaction func unwindtoroot(segue: uistoryboardsegue) { print("successfully unwound") }
then in scoreboard scene want unwind, can control-drag button "exit outlet":
when let go, can pick unwind action:
this achieves "pop root" sort of functionality, not contingent upon using navigation controller.
if want perform unwind programmatically, rather doing segue button exit outlet, view controller icon exit outlet:
then, select segue in document outline , give segue unique storyboard id:
then can programmatically perform segue, using same identifier string:
performseguewithidentifier("unwindtoroot", sender: self)
Comments
Post a Comment