我需要错误修复方面的帮助。我使用 segue 在 ViewController 之间传输。
我有 UITabBarController
和一个 UIViewController
。当我单击 vc 中的按钮时,我移动到第二个 vc。我的第二个 vc 没有 TabBar。 (使用segue)。在我的第二个 vc 中,我有按钮和 UIAlertController。当我单击按钮或警报时,我必须使用 TabBar 转换到第一个 vc,但我的 TabBar 不显示。如何解决这个问题?我不需要
需要使用NavigationController
。
let alert = UIAlertController(title: "Поздравляю", message: "Тренировка окончена", preferredStyle: UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: "Click", style: UIAlertAction.Style.default, handler: { action in self.performSegue(withIdentifier: "backSegue", sender: self) }))
self.present(alert, animated: true, completion: nil)
最佳答案
如果您要以模态方式呈现第二个 ViewController,请将其添加到您的 UIAlertController 操作中:
self.dismiss(animated: true, completion: nil)
关于swift - 过渡到 UITabBarController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56313087/