Created
April 22, 2012 09:16
-
-
Save onevcat/2462898 to your computer and use it in GitHub Desktop.
swizze
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
+(BOOL)swizze { | |
Method oldMethod = class_getInstanceMethod(self, @selector(loadNibNamed:owner:options:)); | |
if (!oldMethod) { | |
return NO; | |
} | |
Method newMethod = class_getInstanceMethod(self, @selector(loadPadNibNamed:owner:options:)); | |
if (!newMethod) { | |
return NO; | |
} | |
method_exchangeImplementations(oldMethod, newMethod); | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment