maksonnie
maksonnie

Reputation: 743

TabBar does not show

Tab bar controller storyboard:

enter image description here

This is how I call that tab bar:

let tabBar = TabBarController()
tabBar.modalPresentationStyle = .fullScreen
self.present(tabBar, animated: true, completion: nil)

But result:

enter image description here

What's wrong?

Upvotes: 0

Views: 97

Answers (3)

Wonixer A
Wonixer A

Reputation: 126

Having segues inside the tab bar controller won't show the tab bar. So don't add segues in the tab bar.

Upvotes: 0

cristian_064
cristian_064

Reputation: 606

You are presenting the TabBarController(), but you have to instance using storyboard, because your view is created using storyboard.

        let storyboard = UIStoryboard(name: "filenamethatcontaineyourtabBar", bundle: nil)
        let vc = storyboard.instantiateViewController(identifier: "storyboardIdOfYourTabBarController")
        self.present(vc, animated: true, completion: nil)

Upvotes: 1

nicksarno
nicksarno

Reputation: 4235

If this is the first screen of your app, you don't need to present it. The first tab will appear automatically. You don't need a custom TabBarController class.

Upvotes: 1

Related Questions