4
votes

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

Here is my storyboard: storyboard and here is the Segue:

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?

1
Are you sure LoginViewController is in navigationController? Check this by print(self.navigationController) in LoginViewController's viewDIdLoad method. - Prajeet Shrestha
@PrajeetShrestha self.navigationController is nil. I created the navigation controller by selecting LoginViewController and doing Editor > Embed In > Navigation Controller - Jacob Brunson

1 Answers

6
votes

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.