Skip to content

Instantly share code, notes, and snippets.

@advantis
Last active December 23, 2015 23:49
Show Gist options
  • Save advantis/6712802 to your computer and use it in GitHub Desktop.
Save advantis/6712802 to your computer and use it in GitHub Desktop.
Simple storyboard segues dispatch
//
// Copyright © 2013 Yuri Kotov
//
@implementation UIViewController (ADVSegueDispatch)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
SEL selector = NSSelectorFromString(segue.identifier);
if ([self respondsToSelector:selector]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:selector withObject:segue.destinationViewController];
#pragma clang diagnostic pop
}
}
#pragma clang diagnostic pop
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment