I'm developing an application using a number of UIViewControllers linked using a UINavigationController. The UINavigationController is set up to have a main menu as its default view. The main menu has two buttons that when pressed display one of two other UIViewControllers. So I have a simple two-layer view hierarchy that looks something like this...
Main Menu (UIViewController) | ---- Menu Option 1 (UIViewController) ---- Menu Option 2 (UIViewController) Now I would like my Menu Option 1 UIViewController to display another UIViewController as a modal view - which works fine. However, I would also like to be able to jump directly from this modal view to the Main Menu...
Main Menu (UIViewController) <-------------- | | ---- Menu Option 1 (UIViewController) | | | ---- Modal View (UIViewController) | Knowing that the UINavigationController is a stack and I need to pop my modal view and the next item I'm wondering how it's even possible....
Is there a simple way to do this without adding a callback method to the Menu Option 1 UIViewController?
I'm happy to take feedback on my implementation as well - something doesn't seem right about this!