Skip to content

Instantly share code, notes, and snippets.

@spotlessicode
Last active August 29, 2015 14:09
Show Gist options
  • Save spotlessicode/b0261a2da66ba2715317 to your computer and use it in GitHub Desktop.
Save spotlessicode/b0261a2da66ba2715317 to your computer and use it in GitHub Desktop.
- (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier
{
//how to set identifier for an unwind segue:
//1. in storyboard -> documento outline -> select your unwind segue
//2. then choose attribute inspector and insert the identifier name
if ([@"UnwindFromSecondView" isEqualToString:identifier]) {
return [[MyCustomUnwindSegue alloc] initWithIdentifier:identifier source:fromViewController destination:toViewController];
}else {
//if you want to use simple unwind segue on the same or on other ViewController this code is very important to mix custom and not custom segue
return [super segueForUnwindingToViewController:toViewController fromViewController:fromViewController identifier:identifier];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment