I have a UIButton and I am trying to connect it to two segues. Which segue is used depends on a number of conditions.
For example, when the UIButton (with title "next") is pressed,
if(condition 1) then go to screen A. else go to screen B.
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if([[segue identifier]isEqualToString:@"nextButtonID"]){
creditCardViewController *cvc = [segue destinationViewController];
}
else if([[segue identifier]isEqualToString:@"next2ButtonID"]){
depositInfoViewController *divc = [segue destinationViewController];
}
}
-(IBAction)nextClicked{
if([accountType isEqualToString:@"patron"]){
[self performSegueWithIdentifier:@"nextButtonID" sender:self];
}
else{
[self performSegueWithIdentifier:@"next2ButtonID" sender:self];
}
}
In the storyboard window, control drag from the view controller icon on the bottom of the view and drag it to the destination view controller, give the segue an identifier, and repeat for the next segue.