UIControl 添加分类
@implementation UIControl (EverPath)
+(void)load
{
#ifdef DEBUG
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class cls = [self class];
Method m1 = class_getInstanceMethod(cls, @selector(sendAction:to:forEvent:));
Method m2 = class_getInstanceMethod(cls, @selector(sendAction_EverPath:to:forEvent:));
method_exchangeImplementations(m1, m2);
});
#endif
}
- (void)sendAction_EverPath:(SEL)action to:(id)target forEvent:(UIEvent *)event
{
[self sendAction_EverPath:action to:target forEvent:event];
YXLog(@"Ever_UIControl_Path:%s,Action:%s\n",NSStringFromClass([target class]).UTF8String,[NSStringFromSelector(action) UTF8String]);
}
@end