Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i add a Navigation Controller to a ModalViewController?

I want to present a Modal view in the middle of the screen in on an iPad. This view will have a search bar and a table view. It will present search results. This is up and running.

Now i need to add a navigation controller so that upon touching a row in the above table view, a detail view will be pushed in from the right to allow the user to determine if this is the item he wanted.

I tried adding a navigation controller to my modal view but it doesn't display and i couldn't find a tutorial for this.

Can someone please give me a hint?

EDIT: I'm starting to think that i first need to push a modal navigation controller and then add the tableview to this, is this the correct approach? Can someone please give some details on this if that's the case?

like image 463
Maciej Swic Avatar asked Jan 21 '23 12:01

Maciej Swic


1 Answers

Yes this is possible. You have to present the NavigationController modal. Your ViewController will be the rootViewController of the UINavigationController.

I posted some code in Adding UINavigationController to existing UIViewController

like image 61
Matthias Bauch Avatar answered Jan 30 '23 12:01

Matthias Bauch