Authored by 孙凯

修改 方法 review by daiqiang

... ... @@ -111,7 +111,7 @@ void yher_collectionViewDidSelectItemAtIndexPath(id self, SEL _cmd, id collectio
Method originMethod = class_getInstanceMethod(delegateClass, originMethodSEL);
Class class = GetSelectorInsClass(delegateClass,originMethodSEL,originMethod);
Class class = GetCollectionViewSelectorInsClass(delegateClass,originMethodSEL,originMethod);
if (class_addMethod(class, swizzleMethodSEL, (IMP)yher_collectionViewDidSelectItemAtIndexPath, "v@:@@")) {
Method swizzleMethod = class_getInstanceMethod(class, swizzleMethodSEL);
... ... @@ -123,7 +123,7 @@ void yher_collectionViewDidSelectItemAtIndexPath(id self, SEL _cmd, id collectio
}
}
Class GetSelectorInsClass(Class hclass, SEL sel, Method sel_method) {
Class GetCollectionViewSelectorInsClass(Class hclass, SEL sel, Method sel_method) {
Class super_class = [hclass superclass];
if (!super_class) {
return hclass;
... ... @@ -132,6 +132,6 @@ Class GetSelectorInsClass(Class hclass, SEL sel, Method sel_method) {
if (method != sel_method) {
return hclass;
}
return GetSelectorInsClass(super_class, sel, sel_method);
return GetCollectionViewSelectorInsClass(super_class, sel, sel_method);
}
@end
... ...
... ... @@ -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
... ...