...
|
...
|
@@ -45,17 +45,6 @@ void yher_webViewDidFinishLoad(id self, SEL _cmd,id webView) |
|
|
[[YH_EventCollector sharedInstance] timeEventEndWithWebView:webView status:YHEventLoadStatusSuc];
|
|
|
}
|
|
|
|
|
|
void yher_webViewDidFailLoadWithError(id self, SEL _cmd,id webView,NSError* error)
|
|
|
{
|
|
|
SEL selector = NSSelectorFromString(@"yher_webViewDidFailLoadWithError");
|
|
|
((void(*)(id, SEL, id,id))objc_msgSend)(self, selector, webView,error);
|
|
|
|
|
|
if (![YHEventReport sharedInstance].isPerformanceTrackEnabled||![YHEventReport sharedInstance].isControllerPerformanceTrackEnable) {
|
|
|
return;
|
|
|
}
|
|
|
[[YH_EventCollector sharedInstance] timeEventEndWithWebView:webView status:YHEventLoadStatusFailed];
|
|
|
}
|
|
|
|
|
|
- (void)yher_webViewSetDelegate:(id<UIWebViewDelegate>)delegate {
|
|
|
[self yher_webViewSetDelegate:delegate];
|
|
|
|
...
|
...
|
@@ -67,12 +56,6 @@ void yher_webViewDidFailLoadWithError(id self, SEL _cmd,id webView,NSError* erro |
|
|
Method dis_swizzledMethod = class_getInstanceMethod(class, @selector(webViewDidFinishLoad:));
|
|
|
method_exchangeImplementations(dis_originMethod, dis_swizzledMethod);
|
|
|
}
|
|
|
|
|
|
if (class_addMethod(class, NSSelectorFromString(@"yher_webViewDidFailLoadWithError"), (IMP)yher_webViewDidFailLoadWithError, "v@:@@")) {
|
|
|
Method dis_originMethod = class_getInstanceMethod(class, NSSelectorFromString(@"yher_webViewDidFailLoadWithError"));
|
|
|
Method dis_swizzledMethod = class_getInstanceMethod(class, @selector(webView:didFailLoadWithError:));
|
|
|
method_exchangeImplementations(dis_originMethod, dis_swizzledMethod);
|
|
|
}
|
|
|
} @catch (NSException *exception) {
|
|
|
YHLog(@"%@ error: %@", self, exception);
|
|
|
}
|
...
|
...
|
|