文章目录
1
2
3
4
5
6
7
+ (void)load{
Method original_setHidden;
Method swizzled_setHidden;
original_setHidder = class_getInstanceMethod(self,@selector(set Hididen));
swizzled_setHidden = class_getInstanceMethod(self,@selector(swizzled_setHidden));
method_exchangeImplementations(original_setHidden,swizzled_setHidden)
}
1
2
3
4
5
-(BOOL)swizzled_setHidden{
NSLog(@"在方法中实现自己想实现的方法");
BOOL result = [self swizzled_setHidden];
return result;
}
文章目录