gpt4 book ai didi

ios - 如何在不使用 UINavigationController 的情况下以编程方式进入 rootViewController

转载 作者:行者123 更新时间:2023-11-28 23:29:23 32 4
gpt4 key购买 nike

我在 iOS 中使用 swift。我必须通过单击按钮从当前 UIViewController 导航回我的 rootViewController,但我没有使用 UINavigationController。

我已经对根 rootViewController 中的按钮进行了操作,该按钮触发了 segue 并通过以下代码从根 UIViewController 转到下一个 VC:

performSegue(withIdentifier: "segueSignUp", 发件人: nil)

如果没有导航 Controller ,我找不到任何答案。

最佳答案

在按钮操作中尝试一下:

@IBAction func buttonClicked(_ sender: UIButton) {
self.dismiss(animated: true, completion: nil)
}

关于ios - 如何在不使用 UINavigationController 的情况下以编程方式进入 rootViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57338806/

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