-1


If 5 screen transitions and return to first, will the code as below work properly?

var now_Page: Int = 5 /// now 5 pages

for i in now_Page{
    self.dismiss(animated: true, completion: nil) /// back 5 pages
}
WaFuNuke
  • 37
  • 10

1 Answers1

0

If you want to go back more than one screen, you should use an unwind segue. Set one up in the storyboard editor and then do:

performSegue(withIdentifier: "unwindSegueToVC1", sender: self)
Alper
  • 2,484
  • 3
  • 31
  • 39