Last active
July 2, 2017 15:37
-
-
Save mavris/22bf9ef8a7410d07e6c6420a371281d9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
SEL defaultSelector = @selector(setObject:forKey:); | |
SEL swizzledSelector = @selector(swizzled_setObject:forKey:); | |
Method defaultMethod = class_getInstanceMethod([self class], defaultSelector); | |
Method swizzledMethod = class_getInstanceMethod([self class], swizzledSelector); | |
BOOL isMethodExists = !class_addMethod([self class], defaultSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment