Reputation: 149
I have a tableViewController that segues as popover to another tableViewController and it works well. But when I try to segue as show (e.g. push) from the second tableViewController to a third tableViewController it does not work, it is segueing as popover since the third tableViewController slides from bottom to top, not from right to left.
I saw this implemented in the Calendar app, the create new event is popover segue (slides from bottom to top) and the Travel time cell segues from right to left, but I can't seem to do that.
If the answer is in code, I would really appreciate if it would be Swift
Screenshot of the app layout - img
Upvotes: 0
Views: 782
Reputation:
You need to make sure that your second table view controller is embedded in a navigation controller for the push segue to work.
Otherwise, as you can see, it will segue to your third table view controller, but Xcode will use the default and end up presenting your controller modally.
To embed your view controller in its own navigation controller, with your second view controller selected, choose Editor > Embed In > Navigation Controller. And that's it.
Update: Thanks for adding a screenshot, I can see already one problem here. You don't need the 3rd navigation controller, and actually you should'nt add it, because it's the reason of your problem. The reason behind that is, the Controller 3 will be pushed onto the stack naturally, because Controller 2 is already embedded in its own Navigation Controller. To illustrate what I'm explaining, this is an working example to show you how it should look like:
Please let me know if you have any questions, I'd be glad to help
Upvotes: 1