Swift: how to show a tab bar controller after a login view

前端 未结 5 1097
抹茶落季
抹茶落季 2021-01-30 22:45

I have seen many posts similar to this here but they are all about Objective-C while I am developing my app in Swift. As you can see from the image I have a login screen view an

5条回答
  •  深忆病人
    2021-01-30 23:43

    Call the Tabbarcontroller from any controller By below Code, default first item is selected

        let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
    
        let nextViewController = storyBoard.instantiateViewController(withIdentifier: "HomeTabBar") as! UITabBarController
    
        self.navigationController?.pushViewController(nextViewController, animated: true)
    

提交回复
热议问题