I’m using a push segue to go from a View Controller into an Animation Controller. I have a push segue in my storyboard file, and this is the code I’m using in my prepareForSegue method:
if([[segue identifier] isEqualToString:@"Push To Table Segue"]){
NSLog(@"Push to table segue called");
ReccyTableViewController *loginViewController = (ReccyTableViewController *)segue.destinationViewController;
[self presentViewController:loginViewController animated:YES completion:nil];
}
This is the code that calls the next segue:
- (void)goToNextView {
[self performSegueWithIdentifier:@"Push To Table Segue" sender:self]
}
The segue works, but the new window flies up from the bottom, rather than being pushed. How can I make it pushed in?
Well, in prepare for segue, you should only “prepare”, and not performing the animation.
Moreover, you are not using your segue animation here, but the animation from
presentViewController, which I think is a modal animation by default. You have literally nothing to do to perform your segue, except callingperformSegueWithIdentifierif you want to do it programmatically, or clicking the button/cell/whatever you linked in your storyboard.EDIT : According to this post, you can use a push Segue only inside a
navigationController. If it is not the case, you could either insert them and hide the navigationbar, or create a custom Segue.