Search code examples
swiftxcodeuiviewcontrollersegue

Xcode - Show segue from modal view controller


I am presenting a modal view controller with a tableView, and then want to perform a push segue when a cell is tapped inside the modally presented view controller.

I set up a view controller and a show (push) segue from the modal view controller to the new view controller, but when I call performSegueWithIdentifier, the new view is presented in a modal fashion (slides up) on top of the initial modal view, instead of coming in from the right.

Anyone know what's going on?

Thanks!


Solution

  • For anyone who has this issue in the future, I figured it out:

    You need another navigation controller. So I perform a modal segue to a new navigation controller, and set the modal view controller as the root view controller of the navigation controller. I can then perform a show segue from the modal view controller to any other as normal.

    :)