Search code examples
ios9uistoryboardxcode7

Can an 'Unwind Segue' work between two storyboards connected by a storyboard reference?


In iOS 9, storyboards can be connected by a 'storyboard reference' that links to a second storyboard by adding a storyboard reference and setting the 'referenced ID' to the name of another storyboard file.

Is it possible to set up an unwind segue in the second file that unwinds to a scene in the first file? If so, what steps are involved, either in Interface Builder or in code?


Solution

  • Starting from your storyboard reference, create a new storyboard reference that will be a reference back to your "Main" storyboard. Make sure you set your Storyboard Identifier on your main as well.

    You will now have a "Main Scene" reference with all you Exits now available. You can now create unwind segues as you normally would. Ctrl-drag from your controller to the Exit marker on the Main Scene and you will be able to select the desired exit.

    enter image description here