swift - 过渡到 UITabBarController

标签 swift segue uistoryboardsegue

我需要错误修复方面的帮助。我使用 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)

StoryBoard

最佳答案

如果您要以模态方式呈现第二个 ViewController,请将其添加到您的 UIAlertController 操作中:

self.dismiss(animated: true, completion: nil)

关于swift - 过渡到 UITabBarController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56313087/

相关文章:

C# Xamarin - 将目标添加到 UILongPressGestureRecognizer,将其传递给在父 UIViewController 中实现的选择器

ios - 如何获取当前segue的标识符

swift - 从右向左连续,无需推送或呈现 ViewController

ios - UICollectionView 初始化问题

IOS 在 Swift 中获取通话分钟数

Swift 3 - 更新后如何添加导航 Controller 按钮(如返回) - 刷新并重新加载我的 View Controller

ios - performSegueWithIdentifier 未按预期显示 View Controller

swift - `find <dir> type -f` 等同于 Swift-Cocoa?

ios - 撤消模式并同时显示转场

swift:在 tableview 部分进行 segueing