UITabBar not showing

alberto_giambone_ca3e462d

Alberto Giambone

Posted on July 19, 2022

UITabBar not showing

Maybe your ios app have a Login ViewController just before a TabBarController, and you want the TabBarController appear after login Success :)
Doing this by:

let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "Home") as! HomeViewController
                nextVC.modalPresentationStyle = .fullScreen
                self.present(nextVC, animated: true, completion: nil)
Enter fullscreen mode Exit fullscreen mode

The result is TabBarItem not appearing in the HomeViewController :(

Image description

You can avoid this by creating a UITabBarController files and assign this at UITabBarController, and point at this instead of HomeViewController

let nextVC = self.storyboard?.instantiateViewController(withIdentifier: "tabBar") as! TabBar
                nextVC.modalPresentationStyle = .fullScreen
                self.present(nextVC, animated: true, completion: nil)
Enter fullscreen mode Exit fullscreen mode

Image description

And the result is the TabBarIter are showed correctly 🥳🥳🥳

💖 💪 🙅 🚩
alberto_giambone_ca3e462d
Alberto Giambone

Posted on July 19, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related