2018-01-08

2018-01-08  本文已影响0人  a62cb8b2c35a

void Swizzle(Class c, SEL origSEL, SEL newSEL)

{

Method origMethod = class_getInstanceMethod(c, origSEL);

Method newMethod = nil;

if (!origMethod) {

origMethod = class_getClassMethod(c, origSEL);

if (!origMethod) {

return;

}

newMethod = class_getClassMethod(c, newSEL);

if (!newMethod) {

return;

}

}else{

newMethod = class_getInstanceMethod(c, newSEL);

if (!newMethod) {

return;

}

}

上一篇 下一篇

猜你喜欢

热点阅读