Modal segue, navigation bar disappears
Just add another Navigation Controller
to your modal view controller. Follow the steps
- Select the
Modal View Controller
- Go to
Editor menu
- Select
Embed In
- Select
Navigation Controller
Run the application. Now it should work perfectly.
Hope this solves your problem.
You could simply do the following to show the navigation bar:
Objective-C
UINavigationController alloc]initWithRootViewController:modalVC];
SWIFT 3
let modelVC = self.storyboard?.instantiateViewController(withIdentifier: "modalVC") as! ModalVC
let navBarOnModal: UINavigationController = UINavigationController(rootViewController: modalVC)
self.present(navBarOnModal, animated: true, completion: nil)
This will show the modal view controller with the navigation bar. Knowledge on Objective-C is limited, so I did not write the part of presenting. You should be able to figure that one out. ;)
Hope this helps!
Modal segues take over the whole screen, so any navigation bars, tool bars, or tab bars that are in the presenting controller will be covered up. If you want a navigation bar on this modal controller, you'll need to add one specifically to it, and add any buttons you want to that new navigation bar (or tool bar). If you don't want to do this, then don't present it modally, do a push to it.