fruitcup fruitcup - 4 months ago 23x
iOS Question

iOS - Push segue incorrectly coming from bottom

I have a push Segue with identifier "LoginSegue" that is meant to transition from "Login View Controller" to "View Controller."

Here is my storyboard:
and here is the Segue:


After a user successfully logs in, I call the following from within the LoginViewController:

performSegueWithIdentifier("LoginSegue", sender: self)

in order to transition from the "Login View Controller" to the "View Controller."

I would expect this transition to occur from right-to-left as it is a Push segue, but for some reason it happens from bottom-to-top.

How can I correct this behavior?


You dont have LoginViewController in the navigationController. If you push another viewcontroller in any viewcontroller which is not inside navigationController it will present modally.

You might have set LoginViewController as a rootViewController of a window programitically or make sure navigationController is initialViewController not the LoginViewController in storyboard.

You can always check if any view controller is in navigationController or not by simply: print(self.navigationController) inside viewDidLoad method of view controller.