gpt4 book ai didi

swift - 执行 segue 丢失导航 Controller

转载 作者:可可西里 更新时间:2023-11-01 01:56:59 24 4
gpt4 key购买 nike

我有一个 Show 类型的 UIStoryboardSegueabSegue 标识符。它从 UIViewController A 导航到 B

在整个应用程序中,我使用自定义的 UINavigationController,它工作得非常好,但在这里却不行。

使用 self.performSegue(id: "abSegue", sender: self) 导致 UINavigationController 丢失,但是使用

let controller = UIStoryboard(name: "Storyboard", bundle: bundle).instantiateViewController(withIdentifier: "B")
navigationController?.pushViewController(controller)

工作正常,我收到预期的 UINavigationController

什么会导致这种行为?

最佳答案

使用

self.performSegue(withIdentifier: segueID, sender: self)

关于swift - 执行 segue 丢失导航 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51843552/

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