登录按钮到TabBarController

时间:2018-04-05 05:31:52

标签: ios iphone swift

所以我登录了UIViewController。我想在用户给用户并传递然后单击按钮后,视图将切换到主页UITabBarController

任何人都知道如何以编程方式执行此操作?

1 个答案:

答案 0 :(得分:1)

成功登录后,只需将窗口的根视图控制器更改为tabbarController

即可
func didLoginSuccess() {
    // let yourTabbarController = .....
    // Dont forget to edit this, put your animation while the view change
    UIApplication.shared.keyWindow?.rootViewController = yourTabbarController 
}
相关问题