在退出操作时,unwind segue不会出现在界面构建中

问题描述 投票:0回答:1

在我的Xcode界面构建器中,我没有找到unwind-segue退出操作。在这种情况下有什么问题?

attached image for more information

ios xcode interface builder
1个回答
0
投票

该Exit面板中可用的segue列表将根据您在其他视图控制器中定义为@IBActions的展开segue进行填充,例如:

@IBAction func unwindFromExampleViewController(segue: UIStoryboardSegue) { }

这告诉iOS,其中包含此动作的UIViewController(我们称之为ViewControllerA)已准备好处理屏幕截图(ViewControllerB)中UIViewController的展开。

你有没有在另一个VC中实现这样的行动?一旦你有了(在一个或多个VC中),你就可以从ViewControllerB的Exit选项列表中选择'unwindFromExampleViewController'。

仅供参考:如果需要,您可以在多个VC中定义相同的展开操作; iOS会选择“最近的”来在它被调用时展开。

您可以在this question here中找到有关使用展开segue的更多详细信息。

© www.soinside.com 2019 - 2024. All rights reserved.