4

My layout in interface builder is as follows.

Initial View Controller: Button 1 ------modal segue--------> UIViewController

Initial View Controller: Button 2 ------show segue------->UINavigationController-------->UITableViewcontroller

The segue from Button 1 works perfectly fine. No problem there.

The segue from Button 2 however shows the UITableViewController sliding up from the bottom (like a modal presentation) and not from the right like it should. Additionally, the navigation bar doesn't have the automatically supplied back button.

If I put embed the initial view controller in a UINavigationController, it does work however I then have a navigation bar on the initial view controller, which I don't want. Setting self.navigationController?.navigationBarHidden = true under viewWillAppear in the initial view controller does seem to work but seems like a hack to me.

Before the deprecated push segues it used to work fine. What might be the problem? I did try deleting and re-creating the segue, but that didn't help. I even tried adding my own back button to the navigation bar and then used it to call self.navigationController?.popViewControllerAnimated(true)

but it doesn't do anything, probably because it actually is showing modally. What should I do here?

Joseph Toronto
  • 1,882
  • 1
  • 15
  • 29

0 Answers0