Controlling a nested UITabController

49 views Asked by At

I have two UITabControllers. One is controllable from UIViewControllers that are nested within the scope of the first UITabController (lower in the hierarchy). When I change the selectedIndex of the one lower in the hierarchy it also change the other one. I've tried many things (see below) and nothing seems to work. Any idea how I can control one and not the other.

// Controls both
self.tabBarController!.selectedIndex = curTab

// Doesn't do anything
(self.storyboard?.instantiateViewController(withIdentifier: "SecondTabBar") as! UITabBarController).selectedIndex = curTab

// Where stb is via classes to the storyboard of UITabController also doesn't work
stb.selectedIndex = curTab
1

There are 1 answers

1
Caleb On BEST ANSWER

I have two UITabControllers. One is controllable from UIViewControllers that are nested within the scope of the first UITabController (lower in the hierarchy).

Containing a tab bar controller inside another tab bar controller is not a supported configuration.