iOS 和 xcode:如何给 segue 一个“故事板 id”,以便我可以以编程方式操作它
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16433120/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS and xcode: how to give a segue a "storyboard id" so that I can programmatically manipulate it
提问by jake9115
I am wanting to create a modal segue from a view controller to an a new view, but not by linking the segue action to a button or anything. Instead, I'd like to just set the segue up so that I can call it in pageDidLoad and have it automatically execute if I want.
我想创建从视图控制器到新视图的模态转场,但不是通过将转场动作链接到按钮或任何东西。相反,我只想设置 segue,以便我可以在 pageDidLoad 中调用它,并在需要时让它自动执行。
To do this, I need to be able to reference the segue, such as this:
为此,我需要能够引用 segue,例如:
[self performSegueWithIdentifier:@"mySegue" sender: ...];
After I control-click-drag a connection in storyboard to create a segue, how can I give it a name for later reference? Thanks!
在我控制并单击并拖动情节提要中的连接以创建转场后,如何为其命名以供以后参考?谢谢!
回答by Shardul
回答by jake9115
Nevermind! In the details pane sidebar of xcode, under the third tab there is an "Identifier" field that can be filled out!
没关系!在 xcode 的详细信息窗格侧边栏中,第三个选项卡下有一个“标识符”字段可以填写!