WKWebView 请求拦截
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ''https' is a URL scheme that WKWebView handles natively'
-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:] + 95
不执行下面代码会报上面错误
+ (void)xx_swizzleWKWebView {
[SWLSwizzle swizzleClassMethod:@selector(handlesURLScheme:) ofClass:[WKWebView class] withMethod:@selector(xx_handlesURLScheme:) ofClass:[WKWebView class]];
}
+ (BOOL)xx_handlesURLScheme:(NSString *)urlScheme {
return YES;
}
我思故我在