I have a segue from a UIViewController
to a UITableViewController
that comes into the scene from the bottom of the screen. However, it goes too far and covers the navigation bar.
My view hierarchy is: Navigation Controller (initial view controller) > UIViewController > UITableViewController (the one that's hiding the navigation bar).
It doesn't seem to matter which kind of segue I use or which Navigation Controller options I choose in Interface Builder. I also tried unhiding the navigation bar with this code but it doesn't work:
override func viewWillAppear(animated: Bool)
{
self.navigationController?.navigationBarHidden = false
}
All of the answers I have found which deal with a navigation bar not showing have been in objective-C. The only Swift answers I've found have been people wanting to hide the navigation bar.
I've spent several hours trying to find a solution so if anyone can help it's be greatly appreciated.
You aren't by any chance using a modal segue are you?
The behaviour you are describing (with the new view coming up from the bottom) sounds like a modal. Modals are designed to cover the entire window so that the user can't interact with the rest of the app until they have dealt with the modal.
Make sure you are using a Show segue.