Search code examples
iosswiftuinavigationcontrolleruitabbarcontrollersegue

TabBar disappear when segue even NavigationController Swift


Well, I'm faced with misunderstanding. I want my UITabBar to stay displayed when I make a segue from my History button (see picture).

  • My segue is on Show.
  • My view is embed in a UINavigationController that is root controller at my UITabBarController.
  • "Show navigation bar" is turned off on my UINavigationController.

And with all that, I have a grey screen on my segue and no UITabBar...

Thank you in advance!

Part of my structure of storyboard


Solution

  • Try creating a popup view. In the storyboard remember to set the identifier for the view controller that you are going to. Then delete the segue.

     let customAlert = self.storyboard?.instantiateViewController(withIdentifier: "view") as! yourViewController
        self.addChild(customAlert)
        self.view.addSubview(customAlert.view)
        customAlert.view.backgroundColor = UIColor.white