Swift 带代码的Segue

Swift 带代码的Segue,swift,segue,Swift,Segue,我有一个带代码的uisearch条形码来搜索一些数据。在我点击其中一些之后,我需要推到另一个UIView 所以我用这个 let vc=self.storyboard?.instantiateViewController(withIdentifier: "id") as! mapViewController self.present(vc, animated: true, completion: nil) 它工作得很好,但在segue之后,视图不在narvigation控制器中,因为它是一个礼物

我有一个带代码的uisearch条形码来搜索一些数据。在我点击其中一些之后,我需要推到另一个UIView

所以我用这个

let vc=self.storyboard?.instantiateViewController(withIdentifier: "id") as! mapViewController
self.present(vc, animated: true, completion: nil)
它工作得很好,但在segue之后,视图不在narvigation控制器中,因为它是一个礼物。所以我想用show segue。 然后我将代码更改为

    self.show(vc, sender: self)
当我运行它时,它不工作并显示

"while an existing transition or presentation is occurring; the navigation stack will not be updated."

在这里使用show segue应该怎么做?

使用
pushViewController
方法

self.navigationController?.pushViewController(vc, animated: true)

使用
pushViewController
方法

self.navigationController?.pushViewController(vc, animated: true)
正如这条信息所暗示的(好吧,它就在你面前大喊大叫)。 你不应该开始你的(动画)序列,直到 最后一个已设置动画的导航动作将完成。 (您的)代码需要重新构造以允许这种情况发生。

正如消息所暗示的(好吧,它会在您的脸上呼喊)。 你不应该开始你的(动画)序列,直到 最后一个已设置动画的导航动作将完成。
(您的)代码需要重新构造以允许这种情况发生。

您当前的ViewController还需要位于导航堆栈中,然后才能推送另一个控制器。首先将当前ViewController设置为导航控制器的rootViewController,然后从当前控制器推送mapViewController。

您的当前ViewController还需要位于导航堆栈中,然后才能推送另一个控制器。首先将当前ViewController设置为导航控制器的rootViewController,然后从当前控制器推送mapViewController。

对不起,我不确定这是什么意思,我不确定这是什么意思