Can I add a navigation controller to the ModalViewController?

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

Now I need to add a navigation controller so that when you touch a row in the above table view, the detailed view is clicked on the right so that the user can determine if this is the desired item.

I tried adding a navigation controller to my modal view, but it does not appear, and I could not find a tutorial for this.

Can someone please give me a hint?

EDIT: I'm starting to think that I first need to click on a modal navigation controller and then add a table view to it, is this true? Can someone please give some details about this if this is the case?

+4
source share
1 answer

Yes it is possible. You must submit a NavigationController motive. Your ViewController will be the rootViewController of the UINavigationController.

I have posted the code in Adding a UINavigationController to an existing UIViewController

+9
source

Source: https://habr.com/ru/post/1339332/