gpt4 book ai didi

ios - 通过代码实现 Segue

转载 作者:行者123 更新时间:2023-12-01 19:07:23 24 4
gpt4 key购买 nike

我是IOS的新手。我正在 Storyboard 中创建授权场景。它由 组成文本字段 (用户名、密码)和按钮 (登陆注册)。登录名和密码正确时, UIAlertView 显示文本“成功”。在此之后,应显示 MainScene。但我无法在 Interface Builder 中创建 segue。如何通过代码实现它?

最佳答案

这是您可以执行的操作:

  • 创建一个从源 ViewController(不是控件)到目标 ViewController 的 Segue。
  • 在 Interface Builder Storyboard文件中为 Segue 命名。
  • 以编程方式执行 Segue:[self performSegueWithIdentifier:@"MySegueIdentifier" sender:nil];

  • Note: To create Segue from a ViewController, hold control down and drag source ViewController instead of a control as you would normally do, to the destination controller.

    关于ios - 通过代码实现 Segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18833184/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com