I'm using a storyboard with Xcode 4.3.3
I want to move to one of two UIViewControllers
depending on an if
condition result.
Is there any way to do that because I tried some code but it's not working and not showing an error.
for ex:
[self performSegueWithIdentifier:@"You identifier" sender:self];
Hold down control and drag from your initial view controller to each destination, one at a time. Each time select the type of segue that you want to use (a push segue will not work unless the initial controller is embedded in a UINavigationController). Then click the each segue, open the attributes inspector, and give each a unique name. Then do something like
if (condition) {
[self performSegueWithIdentifier:@"Segue1" sender:self];
}
else {
[self performSegueWithIdentifier:@"Segue2" sender:self];
}