Skip to content

Instantly share code, notes, and snippets.

@rock88
Created July 8, 2015 09:01
Show Gist options
  • Save rock88/5724b33657c6955ab219 to your computer and use it in GitHub Desktop.
Save rock88/5724b33657c6955ab219 to your computer and use it in GitHub Desktop.
void Swizzle(Class class, SEL selector, void(^block)())
{
Method method = class_getInstanceMethod(class, selector);
//IMP imp = method_getImplementation(method);
method_setImplementation(method, imp_implementationWithBlock(block));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment