Anters Bear
Anters Bear

Reputation: 1956

Controlling a nested UITabController

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

Upvotes: 1

Views: 37

Answers (1)

Caleb
Caleb

Reputation: 125037

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.

Upvotes: 1

Related Questions