Jacob Brunson
Jacob Brunson

Reputation: 1492

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: 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?

Upvotes: 4

Views: 2444

Answers (1)

Prajeet Shrestha
Prajeet Shrestha

Reputation: 8108

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.

Upvotes: 6

Related Questions