#ifdef DEBUG
+ (void)load{
SELsystemSel =@selector(viewWillAppear:);
SELswizzSel =@selector(swiz_viewWillAppear:);
MethodsystemMethod =class_getInstanceMethod([selfclass], systemSel);
MethodswizzMethod =class_getInstanceMethod([selfclass], swizzSel);
BOOL isAdd = class_addMethod(self, systemSel, method_getImplementation(swizzMethod), method_getTypeEncoding(swizzMethod));
if(isAdd) {
class_replaceMethod(self, swizzSel, method_getImplementation(systemMethod), method_getTypeEncoding(systemMethod));
}else{
method_exchangeImplementations(systemMethod, swizzMethod);
}
}
- (void)swiz_viewWillAppear:(BOOL)animated{
[self swiz_viewWillAppear:animated];
NSLog(@"currentClass ---- %@",[self class]);
}
#else
#endif