IOS SDK. How to get segue viewController ids?

Is there a way to get all segue ids for VC?

Or just know if there is a VC segue with id?

Thanks.

+4
source share
2 answers

No, there is no way to do what you are looking for.

If you could tell us why you need it, maybe someone can give you directions for an alternative.

Edited by:

If you really want to do this the way you can use try / catch , something like this should work:

@try
{
    [self performSegueWithIdentifier:@"first" sender:self];

}
@catch (NSException *exception)
{
    if ([exception.name isEqualToString:@"NSInvalidArgumentException"])
    {
        NSLog(@"NSInvalidArgumentException");
        [self performSegueWithIdentifier:@"second" sender:self];
    }
}
+1
source

, , identifiers segues storyboard.

identifier segue, prepareForSegue UIViewController:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
  NSString *segueIdentifier = segue.identifier; //This object stores your segue identifier
  NSLog(@"%@", segueIdentifier);
}
+1

All Articles