...
|
...
|
@@ -109,7 +109,6 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- (void)yher_tableViewSetDelegate:(id<UITableViewDelegate>)delegate {
|
|
|
[self yher_tableViewSetDelegate:delegate];
|
|
|
|
...
|
...
|
@@ -123,10 +122,10 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
|
|
Class delegateClass = [delegate class];
|
|
|
|
|
|
SEL swizzleMethodSEL = NSSelectorFromString(@"yher_tableViewDidSelectRowAtIndexPath");
|
|
|
|
|
|
|
|
|
Method originMethod = class_getInstanceMethod(delegateClass, originMethodSEL);
|
|
|
|
|
|
Class class = GetSelectorInsClass(delegateClass,originMethodSEL,originMethod);
|
|
|
Class class = GetTableViewSelectorInsClass(delegateClass,originMethodSEL,originMethod);
|
|
|
|
|
|
if (class_addMethod(class, swizzleMethodSEL, (IMP)yher_tableViewDidSelectRowAtIndexPath, "v@:@@")) {
|
|
|
Method swizzleMethod = class_getInstanceMethod(class, swizzleMethodSEL);
|
...
|
...
|
@@ -138,7 +137,7 @@ void yher_tableViewDidSelectRowAtIndexPath(id self, SEL _cmd, id tableView, NSIn |
|
|
}
|
|
|
}
|
|
|
|
|
|
Class GetSelectorInsClass(Class hclass, SEL sel, Method sel_method) {
|
|
|
Class GetTableViewSelectorInsClass(Class hclass, SEL sel, Method sel_method) {
|
|
|
Class super_class = [hclass superclass];
|
|
|
if (!super_class) {
|
|
|
return hclass;
|
...
|
...
|
@@ -147,7 +146,6 @@ Class GetSelectorInsClass(Class hclass, SEL sel, Method sel_method) { |
|
|
if (method != sel_method) {
|
|
|
return hclass;
|
|
|
}
|
|
|
return GetSelectorInsClass(super_class, sel, sel_method);
|
|
|
return GetTableViewSelectorInsClass(super_class, sel, sel_method);
|
|
|
}
|
|
|
|
|
|
@end |
...
|
...
|
|