Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested UINavigationControllers and TabBarController

I am having some issues on UI design.

Alternative 1:

  • UINavigationController
    • TabBarController
      • MapViewController
      • UINavigationContoller
        • UITableViewController
          • DetailViewController

Alternative 2:

  • UINavigationController
    • TabBarController
      • MapViewController
      • UITableViewController
        • DetailViewController

In alternative 1 in the navigationitem of DetailViewController the backButton and the title are not being shown but I have the lower tabbar.

In alternative 2 in the navigationitem of DetailViewController the backButton and the title are visible but I am missing the lower tabbar.

Is there any way to have both features of alternative 1 & 2?

I need the the top most Navigation Controller because in the TabBarViewController I have a LeftBarButtonItem showing a side menu (SWRevealViewController).

EDIT

Code in TableViewController

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    poiDetail = [poiManager.listOfPois objectAtIndex:indexPath.row]; // does not work with regions-sections
    [self performSegueWithIdentifier:@"poiDetail" sender:self];
}

where "poiDetail" segue is a push e.g. 'Show' segue.

like image 329
Sanandrea Avatar asked Sep 24 '26 00:09

Sanandrea


1 Answers

Yes I implemented same scenario and facing the same issue, Fortunately I am able to solve this in my application,

I am suggesting Alternative 1

You can set Initial UINavigationController in AppDelegate and maintain application flow with same navigation controller till nested UINavigationController. And set TabBar controller as a RootViewController

In RootViewController of nested NavigationController please hide AppDelegate navigationController's NavigationBar. So you are able to resolved issue of Alternative 1 that you are facing.

I referred this library: https://github.com/juliorimo/CustomTabBar-iOS (Note: This library is just one UINavigationController and TabbarController further Nested UINavigationController flow you have to maintain)

like image 170
Ajay Gabani Avatar answered Sep 26 '26 14:09

Ajay Gabani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!