带有动态生成按钮的故事板
我想知道是否可以在视图之间动态创建 Segues。我正在以编程方式生成所有 UI 按钮。这可能吗?我找不到关于这个主题的任何内容。
谢谢
I am wondering if it is possible to dynamically create segues between views. I am generating all my UI buttons programmatically. Is this possible? I haven't been able to find anything on this topic.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定你所说的“创建segues”是什么意思。但是,如果您的意思是创建在按下时执行 Segue 的按钮,则可以在相应操作中的
UIViewController
上使用performSegueWithIdentifier:sender:
。文档此处。如果你想转换到没有segue的视图,我建议直接调用
presentViewController:animated:completion:
。I am not sure what you mean by "create segues". But if you mean creating buttons which perform segue on being pushed, you can use
performSegueWithIdentifier:sender:
onUIViewController
in respective action. Docs here.If you want to transition to view that there is no segue to, I suggest directly calling
presentViewController:animated:completion:
.