I've written a container controller which I'm using inside a tab bar controller. The container manages a stack of controllers like a UINavigationController
, and I'd like it to behave the same way as a navigation controller does, so that when the tab is tapped while already selected the container pops to the root controller.
I'm not looking for a solution which involves being the tab controller's delegate; I want the container to behave the same way as UINavigationController
and do it automatically when put inside a tab controller.
Update: To respond to some of the scepticism, I was hoping that there might be some undocumented method that UITabBarController calls on UINavigationController which I could implement; however, having put logging in -respondsToSelector:
the only method I've seen is -_appearanceContainer
. However, putting logging in -isKindOfClass:
shows that it's being tested against UINavigationController
in several places.