Swift popToRoot not working

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

This highlighted line, in which popToRoot should be executed, after successful registration should be redirected to the Root View Controller. For some reason this does not work for me, literally nothing happens, not even a mistake.

I tried using

self.navigationController?.popToRootViewControllerAnimated(true)
+4
source share
1 answer

You do not use the navigation controller at all, so I would say that self.navigationController- nil.

You can use unwinding. Therefore, in the root view controller, add this method:

@IBAction func unwindToRoot(segue: UIStoryboardSegue) {
    print("successfully unwound")
}

Then, in your scene, the scoreboard from which you want to relax, you can control- step back from the button to exit "exit":

enter image description here

, :

enter image description here

"-", .


, , :

enter image description here

segue segue :

enter image description here

segue, :

performSegueWithIdentifier("UnwindToRoot", sender: self)
+3

All Articles