0

I have multiple viewcontrollers for a single tab in a tabbar controller.

In the initial viewcontroller, it shows the tabbar with two items. There is also a button that takes you to the second viewcontroller. I want the second viewcontroller to have the initial tabbar controller with the two items. It currently displays no tabbar controller.

How do I achieve this?

enter image description here

Thank you in advance.

hmzfier
  • 554
  • 9
  • 21

3 Answers3

1

Try embedding the two view controllers in a container, and only show the container from the tabbar controller. This way you can only realod what is inside the container, and the tabs will be always visible.

Snacks
  • 513
  • 4
  • 22
0

use this methood in the UIViewController class where you want to hide/not hide the tabBarController

-(BOOL)hidesBottomBarWhenPushed
{
    return NO;
}

See also : this question is the exact opposite to yours, but see if you can make some use of it.

Community
  • 1
  • 1
ShahiM
  • 3,179
  • 1
  • 33
  • 58
0

Doh! I solved my own question.

I was using the "present modally" segue, when instead, the "show" segue will automatically include the root tabbar and navigation controller.

hmzfier
  • 554
  • 9
  • 21