可以通过情节提要参考连接的两个情节提要之间进行“解开Segue"工作吗? [英] Can an 'Unwind Segue' work between two storyboards connected by a storyboard reference?
问题描述
在iOS 9中,可以通过添加故事板参考并将参考ID"设置为另一个故事板文件的名称,通过链接到第二个故事板的故事板参考"来连接故事板.
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.
是否可以在第二个文件中设置一个展开序列,然后将其展开到第一个文件中的场景?如果是这样,那么在Interface Builder或代码中涉及哪些步骤?
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?
推荐答案
从您的情节提要参考开始,创建一个新的情节提要参考,它将作为对您的主"情节提要的参考.确保同时在主机上设置情节提要标识符.
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.
您现在将拥有一个主要场景"参考,其中包含所有可用的退出信息.现在,您可以像平常一样创建放松的序列.按住Ctrl并将其从控制器拖动到主场景上的Exit
标记,您将能够选择所需的出口.
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.
这篇关于可以通过情节提要参考连接的两个情节提要之间进行“解开Segue"工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!