【发布时间】:2017-09-30 11:25:59
【问题描述】:
我有三个 ViewController。当您单击出现警报的Ok 按钮时,我想执行从ThirdViewController 到SecondViewController 的转换。我已经尝试过使用此代码:
alert.addAction(UIAlertAction(title: "Ok!", style: UIAlertActionStyle.default, handler: { action -> Void in
self.performSegue(withIdentifier: "ThirdViewControllerSegueBack", sender: self)
}))
问题是SecondViewController 的新窗口出现了,所以当我点击导航栏上的back 时,它会将我带回到ThirdViewController。我希望它显示FirstViewController。
【问题讨论】:
-
你需要一个放松的转场:stackoverflow.com/questions/12561735/…
-
如果它适用于你的场景,试试这个:stackoverflow.com/questions/45792130/…
-
看看这个方法:(展开segues)medium.com/@mimicatcodes/…
标签: swift xcode uinavigationcontroller segue uialertaction