Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is how I ended up fixing this:</p> <pre><code>- (void) setSelectedViewController:(UIViewController *) selectedViewController { self.viewControllers = [NSArray arrayWithObject:selectedViewController]; [super setSelectedViewController:selectedViewController]; } </code></pre> <p>Basically any tab from 5 on gets its navigation controller replaced by the moreNavigationController when you intiially set the viewControllers on UITabBarController. Therefore, I dynamically set viewControllers to just contain the tab I'm clicking. There never ends up being more than 1 in this case so the moreNavigationController doesn't come into play.</p> <p>When I init my custom controller, I just supply the first tab as the viewControllers so the application can load.</p> <pre><code>- (id) init { self = [super init]; if (self) { self.delegate = self; [self populateTabs]; } return self; } - (void) populateTabs { NSArray *viewControllers = [self.manager createViewsForApplication]; self.viewControllers = [NSArray arrayWithObject:[viewControllers objectAtIndex:0]]; self.tabBar.hidden = YES; MyScrollingTabBar *tabBar = [[MyScrollingTabBar alloc] initWithViews:viewControllers]; tabBar.delegate = self; [self.view addSubview:tabBar]; } </code></pre> <p>For clarity, the tabBar delegate is set to this class so that it can respond to tab clicks. The delegate method is as follows:</p> <pre><code>- (void) tabBar:(id) bar clickedTab:(MyScrollingTabBarItem *) tab {  if (self.selectedViewController == tab.associatedViewController) { [(UINavigationController *) tab.associatedViewController popToRootViewControllerAnimated:YES]; } else { self.selectedViewController = tab.associatedViewController; } // keep nav label consistent for tab self.navigationController.title = tab.label.text; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload