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

前端 未结 5 1094
抹茶落季
抹茶落季 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:29

    Give your tab bar controller a StoryboardID (say "tabbar") and push it just like a normal UIViewController:

    let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "tabbar") as! UIViewController
    
    self.navigationController?.pushViewController(nextViewController, animated: true)
    

提交回复
热议问题