0

I created a viewcontroller of UITabBarController() which is a rootviewcontroller of a UINavigationController. There are three subChildViewController in UITabBarController. If I selected non-first segment and exist the UITabBarController, then I enter the UITabBarController again, the navigationBar won't shown. It only repro in iOS version between iOS 11.0 and 11.2.

Rakesh Patel
  • 1,673
  • 10
  • 27
lypw2009
  • 201
  • 3
  • 11
  • post some code. if its a gif or video then it will be fine. Are you hiding navigation bar somewhere? – Vinodh May 02 '18 at 11:33
  • give us some gif of your storyboard and see this [link](https://stackoverflow.com/questions/29458948/how-to-use-navigation-controller-inside-of-uitabbarcontroller-with-storyboard-on). It may help you. – MD. Rejaul Hasan May 02 '18 at 12:24

2 Answers2

0

A tabbar controller contains an array for x view controllers. Each of the view controllers may or may not be embedded in a nav bar controller.

The tab bar controller shouldn’t be embedded in a nav bar.

Mark
  • 515
  • 2
  • 4
  • 8
  • The logical is like this: VC1 which is the root of a navigationController. Push VC2 into the navigationController in the viewDidLoad of VC1. the view of TabBarViewController is a subView of VC2. – lypw2009 May 03 '18 at 01:44
0

I would agree with Mark, TabBar shouldn't be embedded in a navBar, but it works the other way, with a navBar able to be embedded into each tab of a tabBar.

I'm not sure exactly what you are trying to do, why you have a navBar before the tabBar, but if your goal is something like a login page that then goes to the TabBar, you can get from the tabBar back to the original ViewController via a button or some other action that calls code similar to the following: let appDelegate = UIApplication.shared.delegate! as! AppDelegate let mainStoryboard = UIStoryboard(name: "Main", bundle: nil) let vc = mainStoryboard.instantiateViewController(withIdentifier: "ViewStoryBoardName") as! SpecificViewController appDelegate.window?.set(rootViewController: vc)

Ryan Pyeatt
  • 113
  • 6