Last active
December 23, 2015 23:49
-
-
Save advantis/6712802 to your computer and use it in GitHub Desktop.
Simple storyboard segues dispatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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