Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested UINavigationControllers

Is it possible to have a UINavigationController within a UINavigationController? I'm running into problems with it and have read conflicting reports:

iPhone UINavigationController inside UIViewController

App with nested UINavigationController crashes in iOS SDK 4.2

The application contains a couple of 2-3 step sub-workflows that I need to re-use in different places within the main workflow, hence the nesting. I could have one master UINavigation controller that has a lot of workflow logic in it, but I prefer to model them as independent sub-workflows.

Side note -- it works if I launch the sub-workflow with presentModalViewController (since this is valid for all UIViews), but will only display the titlebar and not the view when I launch it with pushViewController. I don't want it modal since it covers up the whole screen.

like image 733
Stephen Petschulat Avatar asked Oct 12 '22 05:10

Stephen Petschulat


1 Answers

I don't know if it's possible (i.e. there's a way to hack it such that it kind of works) but is certainly not recommended to use more than a single UINavigationController. I would question the app design if you feel this is necessary as it will be complex not only in implementation but for your users.

An encapsulated approach would be to have your primary UI use a single UINavigationController. When a user does an action that branches into it's own logical flow, present a new navigation controller as a modal view controller and have the user complete that logic flow and dismiss the modal when done back to your primary UI.

like image 97
XJones Avatar answered Oct 27 '22 00:10

XJones