"Show" segue not sliding in from right side (only from bottom)

Hi there,

I’m a bit stumped with an issue I’m having and am wondering if anybody could chime in with some possible workarounds/fixes.

I’ve got an application that’s set up using Storyboards. I’m running into a problem when trying to segue from one view controller to another. Instead of the next view controller sliding in from the right, it only slides in from the bottom.

The setup of the storyboard/view controllers is as such:

  • Login Screen (Embedded in a Navigation Controller)
  • Dashboard Screen (Embedded in a Navigation Controller), which segues from the right when segueing to it from the Login Screen.
  • The Dashboard Screen then has a Page View Controller as its direct subview.
  • The Page View Controller then has a list of View Controllers added to it (by way of calling setViewControllers.
  • Inside one of the Page View Controller’s View Controllers, I’ve got a button labelled “Show More”.
  • When tapping on “Show More” I’m attempting to segue to another screen which is a TableViewController embedded within a Navigation Controller.

The problem I’m having is when performing the segue on button tap, the transition doesn’t slide from the right (similar to other screen transitions), but instead slides up from the bottom.

Is there a reason why the transition isn’t following the others? Is it due to how the screens are setup (i.e.: page view controller, etc.).

Any help is appreciated. If you need any more info I’d be more than happy to supply it. I didn’t want to post too much so as not to flood you with unnecessary info.

Thank you!
Frank

What you want to do is a lot simpler than the case showed in this tutorial, but it shows how to use the UIViewControllerAnimatedTransitioning protocol to achieve a custom animation effect on the show segue - maybe you could adapt the method?

I ended up figuring out that the reason the segue wasn’t sliding from the right was because the View Controller that was being presented was in its own NavigationController.

I’m guessing that if you try to present a NavigationController from another NavigationController, it won’t segue from the side and instead does it from the bottom; presumably so as not to mix the navigation stacks… ?

Not sure if that’s the right explanation, but it seems to work when I don’t embed the TableViewController inside its own NavigationController.

1 Like