Created
January 10, 2015 06:27
-
-
Save threetreeslight/80985ab76f132813c00e to your computer and use it in GitHub Desktop.
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
#import "UIViewController+RPRIS.h" | |
#import <objc/runtime.h> | |
@implementation UIViewController (Foo) | |
+ (void)swizzlingMethodViewWillApper | |
{ | |
Method originalMethod = class_getInstanceMethod(self, viewWillApper:); | |
Method swizzledMethod = class_getInstanceMethod(self, foo_viewWillApper:); | |
method_exchangeImplementations(originalMethod, swizzledMethod); | |
} | |
- (void)foo_viewWillAppear:(BOOL)animated | |
{ | |
[self foo_viewWillAppear:animated]; | |
NSLog(@"swizzled viewWillApper Yeah!!"); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment