在 Swift 中对 UITabBarController 进行 segue 后如何摆脱 UINavigationController?

How to get rid of UINavigationController after doing a segue to a UITabBarController in Swift?

我基本上想在 login/registration 成功后 "get rid" 我为我的 login/registration NavigationController 设置的 NavigationController。基本上,当 Login/Register 按钮被按下时,我在执行一些通过 IBAction 运行的代码后进行手动 segue。我的代码运行得很好,但问题是每当 segue 执行时,我的第二个视图控制器 TabBarController(我想在某种程度上独立于 NavigationController)仍然在视图顶部有导航栏(带有 <Back 按钮)。我正在通过推送 segue 进行转换,这让我意识到这不是正确的方法,因为这意味着我将 TabBarController 嵌套到 NavigationController 本身中。就是不知道怎么让它独立。

我的方法如下:

//...After various checks/functions, inside a function, I redirect myself to the TabBarController

self.performSegueWithIdentifier("redirectToMenuFromRegistration", sender: nil)

//Where the segue "redirectToMenuFromRegistration" is my TabBarController..

正如我所说,我不希望我的 TabBarController 嵌套在我的 NavigationController 中,我希望它在某种程度上是独立的。现在另一个问题。如果我这样做,我还能通过 ViewController 传递数据吗?

非常感谢您的帮助!

干杯!

在故事板中将 segue "Show" 设置为 "Present Modally"。