如何在另一个故事板中添加故事板引用

问题描述:

我有2个故事板 - mainStoryBoard1 mainStoryBoard2

I have 2 storyboard - mainStoryBoard1 and mainStoryBoard2.

我需要执行一个segue,从 ViewController of mainStoryBoard1 ViewController of mainStoryBoard2。 / code>

I need to perform a segue from ViewController of mainStoryBoard1 to ViewController of mainStoryBoard2.

任何人都知道怎么做?

Xcode 7中的Interface Builder在对象库中有Storyboard Reference对象:

Interface Builder in Xcode 7 has "Storyboard Reference" object in the "Object library":

只需将其拖到故事板上即可。然后,您可以选择该故事板参考并在属性检查器中指定它所引用的故事板:

Just drag that onto your storyboard. You can then select that storyboard reference and specify the storyboard to which it refers in the attributes inspector:

然后,您现在可以将segue添加到此引用中,您将从一个故事板中的场景转移到另一个故事板中的场景。

Then you can now add segue to this reference and you'll segue from the scene in one storyboard to a scene in another storyboard.