uiviewcontroller - Swift popToRoot not working -


www.dropbox.com/s/jrzrst5qtfq6op2/screenshot%202015-03-20%2022.27.42.png?dl=0

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":

enter image description here

when let go, can pick unwind action:

enter image description here

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:

enter image description here

then, select segue in document outline , give segue unique storyboard id:

enter image description here

then can programmatically perform segue, using same identifier string:

performseguewithidentifier("unwindtoroot", sender: self) 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -