Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unwind segue in multiple storyboards environment

My app has more than two storyboards. In storyboard A, it has navigation view controller, root view controller and several view controllers. It also has an unwind segue, like returnToTopScreen. Storyboard B has several view controllers. At execution, all VC in B is on the navigation stack.

My question is,

Can unwind segue work for inter storyboards unwinding?

According to my trial, Xcode6.2 allows a UIbutton in VC of storyboard B to connect with an unwind segue in storyboard A. But it does not work.

like image 494
kmugitani Avatar asked Dec 29 '25 02:12

kmugitani


1 Answers

Yes, you can unwind between storyboards as long as you got to the controller in the second storyboard by pushing or presenting from one of the controllers in the sequence that leads back to the one you want to unwind to. I tested this in a setup where the main storyboard had a navigation controller with its root view controller, and one other controller that was pushed to from the root. In that controller, I instantiated the controller in the second storyboard, and either pushed or presented it. An unwind from that controller in the second storyboard successfully went back to the root of the navigation controller.

like image 97
rdelmar Avatar answered Dec 30 '25 15:12

rdelmar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!