Reputation: 43
I have a UIView
which is embedded inside of a NavigationController
. When the user clicks on a cell in a TableView
he is taken to the UIView
. However, the UIView
pops out from the bottom instead of sliding out from the right side. I have the segue set to Show, so I am not sure why it is doing this.
Upvotes: 0
Views: 1158
Reputation: 353
A Navigation controller shouldn't be embedded inside another navigation controller.
remove root view relationship between View and NavigationController, delete the NavigationController and set "show" segue directly from TableView to that view.
Upvotes: 0
Reputation: 8718
The slide-in from the side behavior only works when all of the child navigation controllers are children of the same UINavigationController. This requirement includes the "root", or first, child. In your case the root child is the UITableViewController.
It will look like this in Storyboard:
UINavVC ---> RootChildVC ---> SecondChildVC ---> ThirdChildVC etc.
A show segue is contextual. If it is as in the diagram above, it will be a horizontal slide.
In any other situation at all, including a hand-drawn segue between two arbitrary VCs, a show is interpreted as a modal presentation which comes in from the bottom and slides back down. You also don't get the automatic "back" button installation because there is no "navigation" relationship detected.
You're probably confused and need to re-do your Storyboard into the above simple idiom. If you're segueing between "cousins" that is VCs whose direct parents are different UINavigationControllers, they fall under "any other situation".
Upvotes: 2