带有动态生成按钮的故事板

发布于 2025-01-07 11:03:27 字数 83 浏览 2 评论 0原文

我想知道是否可以在视图之间动态创建 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

能怎样 2025-01-14 11:03:27

我不确定你所说的“创建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: on UIViewController 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:.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文