美文网首页
iOS 点击哪个按钮 知道是哪个页面的哪个点击事件

iOS 点击哪个按钮 知道是哪个页面的哪个点击事件

作者: 来敲代码 | 来源:发表于2022-11-24 11:47 被阅读0次

    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
    

    相关文章

      网友评论

          本文标题:iOS 点击哪个按钮 知道是哪个页面的哪个点击事件

          本文链接:https://www.haomeiwen.com/subject/hadzxdtx.html