Insert subview behind TabBar from child view of TabBarController
For some reason, when inserting a subview into a UITabBarController
behind it's UITabBar
, although the view is visible to the user, the system itself seems to think it is not and so although viewDidLoad()
is called, viewDidAppear()
and subsequent methods are not.
However, adding a subview above the UITabBar
seems to work fine. So I solved this by adding my own new UITabBar
as a subview to the UITabBarController
(set up basically exactly as the default one would be) and then removing the UITabBarController's
default UITabBar
.
Then when later inserting my view into the UITabBarController
, I insert it as I was doing originally but instead below/behind my custom UITabBar
and it seems to load fine.