wkwebView基本使用方法
WKWebView有两个delegate,WKUIDelegate 和 WKNavigationDelegate。WKNavigationDelegate主要处理一些跳转、加载处理操作,WKUIDelegate主要处理JS脚本,确认框,警告框等。因此WKNavigationDelegate更加常用。
比较常用的方法:
#pragma mark - lifeCircle
- (void)viewDidLoad {[super viewDidLoad];webView = [[WKWebView alloc]init];[self.view addSubview:webView];[webView mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.view);make.right.equalTo(self.view);make.top.equalTo(self.view);make.bottom.equalTo(self.view);}];webView.UIDelegate = self;webView.navigationDelegate = self;[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.baidu.com"]]];}#pragma mark - WKNavigationDelegate
// 页面开始加载时调用
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{}
// 当内容开始返回时调用
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{}
// 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{}
// 页面加载失败时调用
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{}
// 接收到服务器跳转请求之后调用
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation{}
// 在收到响应后,决定是否跳转
- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler{NSLog(@"%@",navigationResponse.response.URL.absoluteString);//允许跳转decisionHandler(WKNavigationResponsePolicyAllow);//不允许跳转//decisionHandler(WKNavigationResponsePolicyCancel);
}
// 在发送请求之前,决定是否跳转
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler{NSLog(@"%@",navigationAction.request.URL.absoluteString);//允许跳转decisionHandler(WKNavigationActionPolicyAllow);//不允许跳转//decisionHandler(WKNavigationActionPolicyCancel);
}
#pragma mark - WKUIDelegate
// 创建一个新的WebView
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures{return [[WKWebView alloc]init];
}
// 输入框
- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * __nullable result))completionHandler{completionHandler(@"http");
}
// 确认框
- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler{completionHandler(YES);
}
// 警告框
- (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{NSLog(@"%@",message);completionHandler();
}
OC与JS交互
WKWebview提供了API实现js交互 不需要借助JavaScriptCore或者webJavaScriptBridge。使用WKUserContentController实现js native交互。简单的说就是先注册约定好的方法,然后再调用。
JS调用OC方法
oc代码(有误,内存不释放):
@interface ViewController ()<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler>{WKWebView * webView;WKUserContentController* userContentController;
}
@end
@implementation ViewController
#pragma mark - lifeCircle
- (void)viewDidLoad {[super viewDidLoad];//配置环境WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];userContentController =[[WKUserContentController alloc]init];configuration.userContentController = userContentController;webView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, 100, 100) configuration:configuration];//注册方法[userContentController addScriptMessageHandler:self name:@"sayhello"];//注册一个name为sayhello的js方法[self.view addSubview:webView];[webView mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.view);make.right.equalTo(self.view);make.top.equalTo(self.view);make.bottom.equalTo(self.view);}];webView.UIDelegate = self;webView.navigationDelegate = self;[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.test.com"]]];
}
- (void)dealloc{//这里需要注意,前面增加过的方法一定要remove掉。[userContentController removeScriptMessageHandlerForName:@"sayhello"];
}
#pragma mark - WKScriptMessageHandler
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{NSLog(@"name:%@\\\\n body:%@\\\\n frameInfo:%@\\\\n",message.name,message.body,message.frameInfo);
}
@end
上面的OC代码如果认证测试一下就会发现dealloc并不会执行,这样肯定是不行的,会造成内存泄漏。原因是[userContentController addScriptMessageHandler:self name:@"sayhello"];
这句代码造成无法释放内存。(ps:试了下用weak指针还是不能释放,不知道是什么原因。)因此还需要进一步改进,正确的写法是用一个新的controller来处理,新的controller再绕用delegate绕回来。
oc代码(正确写法):
@interface ViewController ()<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler>{WKWebView * webView;WKUserContentController* userContentController;
}
@end
@implementation ViewController
#pragma mark - lifeCircle
- (void)viewDidLoad {[super viewDidLoad];//配置环境WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];userContentController =[[WKUserContentController alloc]init];configuration.userContentController = userContentController;webView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, 100, 100) configuration:configuration];//注册方法WKDelegateController * delegateController = [[WKDelegateController alloc]init];delegateController.delegate = self;[userContentController addScriptMessageHandler:delegateController name:@"sayhello"];[self.view addSubview:webView];[webView mas_makeConstraints:^(MASConstraintMaker *make) {make.left.equalTo(self.view);make.right.equalTo(self.view);make.top.equalTo(self.view);make.bottom.equalTo(self.view);}];webView.UIDelegate = self;webView.navigationDelegate = self;[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.test.com"]]];
}
- (void)dealloc{//这里需要注意,前面增加过的方法一定要remove掉。[userContentController removeScriptMessageHandlerForName:@"sayhello"];
}
#pragma mark - WKScriptMessageHandler
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{NSLog(@"name:%@\\\\n body:%@\\\\n frameInfo:%@\\\\n",message.name,message.body,message.frameInfo);
}
@end
WKDelegateController代码:
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
@protocol WKDelegate <NSObject>- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message;@end@interface WKDelegateController : UIViewController <WKScriptMessageHandler>@property (weak , nonatomic) id<WKDelegate> delegate;@end
.m代码:
#import "WKDelegateController.h"@interface WKDelegateController ()@end@implementation WKDelegateController- (void)viewDidLoad {[super viewDidLoad];
}- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{if ([self.delegate respondsToSelector:@selector(userContentController:didReceiveScriptMessage:)]) {[self.delegate userContentController:userContentController didReceiveScriptMessage:message];}
}@end
h5代码:
<html>
<head><script>
function say()
{
//前端需要用 window.webkit.messageHandlers.注册的方法名.postMessage({body:传输的数据} 来给native发送消息window.webkit.messageHandlers.sayhello.postMessage({body: 'hello world!'});
}
</script>
</head><body><h1>hello world</h1><button onclick="say()">say hello</button></body></html>
打印出的log:
name:sayhellobody:{body = "hello world!";
}frameInfo:<WKFrameInfo: 0x7f872060ce20; isMainFrame = YES; request = <NSMutableURLRequest: 0x618000010a30> { URL: http://www.test.com/ }>
注意点
addScriptMessageHandler
要和removeScriptMessageHandlerForName
配套出现,否则会造成内存泄漏。- h5只能传一个参数,如果需要多个参数就需要用字典或者json组装。
oc调用JS方法
代码如下:
- (void)webView:(WKWebView *)tmpWebView didFinishNavigation:(WKNavigation *)navigation{//say()是JS方法名,completionHandler是异步回调block[webView evaluateJavaScript:@"say()" completionHandler:^(id _Nullable result, NSError * _Nullable error) {NSLog(@"%@",result);}];}
h5代码同上。
WebViewJavascriptBridge
一般来说,一个好的UI总有一个大神会开发出一个好的第三方封装框架。WebViewJavascriptBridge的作者也做了一套支持WKWebView与JS交互的第三方框架:WKWebViewJavascriptBridge。
cocoaPods: pod 'WebViewJavascriptBridge', '~> 5.0.5'
github地址:https://github.com/marcuswestin/WebViewJavascriptBridge
主要方法如下:
//初始化方法
+ (instancetype)bridgeForWebView:(WKWebView*)webView;
+ (void)enableLogging;//注册函数名
- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler;//调用函数名
- (void)callHandler:(NSString*)handlerName;
- (void)callHandler:(NSString*)handlerName data:(id)data;
- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback;//重置
- (void)reset;//设置WKNavigationDelegate
- (void)setWebViewDelegate:(id<WKNavigationDelegate>)webViewDelegate;
基本的实现方法和上面写的差不多,就是封装了一下,有兴趣的童鞋可以自己pod下来使用。
文/o翻滚的牛宝宝o(简书作者)
原文链接:http://www.jianshu.com/p/4fa8c4eb1316
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
iOS8
之后,苹果推出了WebKit
这个框架,用来替换原有的UIWebView
,新的控件优点多多,不一一叙述。由于一直在适配iOS7
,就没有去替换,现在仍掉了iOS7
,以为很简单的就替换过来了,然而在替换的过程中,却遇到了很多坑。还有一点就是原来写过一篇文章 Objective-C与JavaScript交互的那些事以为年代久远的UIWebView
已经作古,可这篇文章现在依然有一定的阅读量。所以在决定在续一篇此文,以引导大家转向WKWebView
,并指出自己踩过的坑,让大家少走弯路。
此篇文章的逻辑图
WKWebView使用
WKWebView简单介绍
使用及注意点
WKWebView
只能用代码创建,而且自身就支持了右滑返回手势allowsBackForwardNavigationGestures
和加载进度estimatedProgress
等一些UIWebView
不具备却非常好用的属性。在创建的时候,指定初始化方法中要求传入一个WKWebViewConfiguration
对象,一般我们使用默认配置就好,但是有些地方是要根据自己的情况去做更改。比如,配置中的allowsInlineMediaPlayback
这个属性,默认为NO
,如果不做更改,网页中内嵌的视频就无法正常播放。
更改User-Agent
有时我们需要在User-Agent
添加一些额外的信息,这时就要更改默认的User-Agent
在使用UIWebView
的时候,可用如下代码(在使用UIWebView
之前执行)全局更改User-Agent
:
1 2 3 4 5 6 7 8 9 10 |
// 获取默认User-Agent UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero]; NSString *oldAgent = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"]; // 给User-Agent添加额外的信息 NSString *newAgent = [NSString stringWithFormat:@"%@;%@", oldAgent, @"extra_user_agent"]; // 设置global User-Agent NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:newAgent, @"UserAgent", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary]; |
以上代码是全局更改User-Agent
,也就是说,App
内所有的Web
请求的User-Agent
都被修改。替换为WKWebView
后更改全局User-Agent
可以继续使用上面的一段代码,或者改为用WKWebView
获取默认的User-Agent
,代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
self.wkWebView = [[WKWebView alloc] initWithFrame:CGRectZero]; // 获取默认User-Agent [self.wkWebView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) { NSString *oldAgent = result; // 给User-Agent添加额外的信息 NSString *newAgent = [NSString stringWithFormat:@"%@;%@", oldAgent, @"extra_user_agent"]; // 设置global User-Agent NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:newAgent, @"UserAgent", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary]; }]; |
对比发现,这两种方法并没有本质的区别,一点小区别在于一个是用UIWebView
获取的默认User-Agent
,一个是用WKWebView
获取的默认User-Agent
。上面方法的缺点也是很明显的,就是App
内所有Web
请求的User-Agent
全部被修改。
在iOS9
,WKWebView
提供了一个非常便捷的属性去更改User-Agent
,就是customUserAgent
属性。这样使用起来不仅方便,也不会全局更改User-Agent
,可惜的是iOS9
才有,如果适配iOS8
,还是要使用上面的方法。
WKWebView的相关的代理方法
WKWebView
的相关的代理方法分别在WKNavigationDelegate
和WKUIDelegate
以及WKScriptMessageHandler
这个与JavaScript
交互相关的代理方法。
WKNavigationDelegate
: 此代理方法中除了原有的UIWebView
的四个代理方法,还增加了其他的一些方法,具体可参考我下面给出的Demo
。WKUIDelegate
: 此代理方法在使用中最好实现,否则遇到网页alert
的时候,如果此代理方法没有实现,则不会出现弹框提示。WKScriptMessageHandler
: 此代理方法就是和JavaScript
交互相关,具体介绍参考下面的专门讲解。
WKWebView使用过程中的坑
WKWebView下面添加自定义View
因为我们有个需求是在网页下面在添加一个View
,用来展示此链接内容的相关评论。在使用UIWebView
的时候,做法非常简单粗暴,在UIWebView
的ScrollView
后面添加一个自定义View
,然后根据View
的高度,在改变一下scrollView
的contentSize
属性。以为WKWebView
也可以这样简单粗暴的去搞一下,结果却并不是这样。
首先改变WKWebView
的scrollView
的contentSize
属性,系统会在下一次帧率刷新的时候,再给你改变回原有的,这样这条路就行不通了。我马上想到了另一个办法,改变scrollView
的contentInset
这个系统倒不会在变化回原来的,自以为完事大吉。后来过了两天,发现有些页面的部分区域的点击事件无法响应,百思不得其解,最后想到可能是设置的contentInset
对其有了影响,事实上正是如此。查来查去,最后找到了一个解决办法是,就是当页面加载完成时,在网页下面拼一个空白的div
,高度就是你添加的View
的高度,让网页多出一个空白区域,自定义的View
就添加在这个空白的区域上面。这样就完美解决了此问题。具体可参考Demo
所写,核心代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
self.addView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, addViewHeight)]; self.addView.backgroundColor = [UIColor redColor]; [self.webView.scrollView addSubview:self.addView]; NSString *js = [NSString stringWithFormat:@"\ var appendDiv = document.getElementById(\"AppAppendDIV\");\ if (appendDiv) {\ appendDiv.style.height = %@+\"px\";\ } else {\ var appendDiv = document.createElement(\"div\");\ appendDiv.setAttribute(\"id\",\"AppAppendDIV\");\ appendDiv.style.width=%@+\"px\";\ appendDiv.style.height=%@+\"px\";\ document.body.appendChild(appendDiv);\ }\ ", @(addViewHeight), @(self.webView.scrollView.contentSize.width), @(addViewHeight)]; [self.webView evaluateJavaScript:js completionHandler:nil]; |
WKWebView加载HTTPS的链接
HTTPS
已经越来越被重视,前面我也写过一系列的HTTPS
的相关文章HTTPS从原理到应用(四):iOS中HTTPS实际使用当加载一些HTTPS
的页面的时候,如果此网站使用的根证书已经内置到了手机中这些HTTPS
的链接可以正常的通过验证并正常加载。但是如果使用的证书(一般为自建证书)的根证书并没有内置到手机中,这时是链接是无法正常加载的,必须要做一个权限认证。开始在UIWebView
的时候,是把请求存储下来然后使用NSURLConnection
去重新发起请求,然后走NSURLConnection
的权限认证通道,认证通过后,在使用UIWebView
去加载这个请求。
在WKWebView
中,WKNavigationDelegate
中提供了一个权限认证的代理方法,这是权限认证更为便捷。代理方法如下:
1 2 3 4 5 6 7 8 9 10 11 12 |
- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler { if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { if ([challenge previousFailureCount] == 0) { NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]; completionHandler(NSURLSessionAuthChallengeUseCredential, credential); } else { completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); } } else { completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil); } } |
这个方法比原来UIWebView
的认证简单的多。但是使用中却发现了一个很蛋疼的问题,iOS8
系统下,自建证书的HTTPS
链接,不调用此代理方法。查来查去,原来是一个bug
,在iOS9
中已经修复,这明显就是不管iOS8
的情况了,而且此方法也没有标记在iOS9
中使用,这点让我感到有点失望。这样我就又想到了换回原来UIWebView
的权限认证方式,但是试来试去,发现也不能使用了。所以关于自建证书的HTTPS
链接在iOS8
下面使用WKWebView
加载,我没有找到很好的办法去解决此问题。这样我不得已有些链接换回了HTTP
,或者在iOS8
下面在换回UIWebView
。如果你有解决办法,也欢迎私信我,感激不尽。
WKWebView和JavaScript交互
WKWebView
和JavaScript
交互,在WKUserContentController.h
这个头文件中- (void)addScriptMessageHandler:(id )scriptMessageHandler name:(NSString *)name;
这个方法的注释中已经明确给出了交互办法。使用起来倒是非常的简单。创建WKWebView
的时候添加交互对象,并让交互对象实现WKScriptMessageHandler
中的唯一的一个代理方法。具体的方式参考Demo中的使用。
1 2 3 4 5 |
// 添加交互对象 [config.userContentController addScriptMessageHandler:(id)self.ocjsHelper name:@"timefor"]; // 代理方法 - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message; |
JavaScript
调用Objective-C
的时候,使用window.webkit.messageHandlers.timefor.postMessage({code: '0001', functionName: 'getdevideId'}); Objective-C
自动对交互参数包装成了WKScriptMessage
对象,其属性body
则为传送过来的参数,name
为添加交互对象的时候设置的名字,以此名字可以过滤掉不属于自己的交互方法。其中body
可以为NSNumber, NSString, NSDate, NSArray, NSDictionary, and NSNull。
而Objective-C
在回调JavaScript
的时候,不能像我原来在 Objective-C与JavaScript交互的那些事这篇文章中写的那样,JavaScript
传过来一个匿名函数,Objective-C
这边直接调用一下就完事。WKWebView
没有办法传过来一个匿名函数,所以回调方式,要么执行一段JavaScript
代码,或者就是调用JavaScript
那边的一个全局函数。一般是采用后者,至于Web
端虽说暴露了一个全局函数,同样可以把这一点代码处理的很优雅。Objective-C
传给JavaScript
的参数,可以为Number, String, and Object
。参考如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// 数字 NSString *js = [NSString stringWithFormat:@"globalCallback(%@)", number]; [self.webView evaluateJavaScript:js completionHandler:nil]; // 字符串 NSString *js = [NSString stringWithFormat:@"globalCallback(\'%@\')", string]; [self.webView evaluateJavaScript:js completionHandler:nil]; // 对象 NSString *js = [NSString stringWithFormat:@"globalCallback(%@)", @{@"name" : @"timefor"}]; [self.webView evaluateJavaScript:js completionHandler:nil]; // 带返回值的JS函数 [self.webView evaluateJavaScript:@"globalCallback()" completionHandler:^(id result, NSError * _Nullable error) { // 接受返回的参数,result中 }]; |
此文的Demo地址:WKWebViewDemo 如果此文对你有所帮助,请给个star
吧。
参考
- http://stackoverflow.com/questions/34693311/links-in-wkwebview-randomly-not-clickable/35100064#35100064
- https://bugs.webkit.org/show_bug.cgi?id=140197
- https://www.cnblogs.com/oc-bowen/p/5946383.html
wkwebView基本使用方法相关推荐
- WKWebView Safari调试、JS互调、加载进度条、JS中alert、confirm、prompt
主要内容 Safari调试 swift/OC与JS互调 增加加载进度条 支持JS中alert.confirm.prompt Safari调试 设置 -> safari --> 高级,开启J ...
- iOS与JS交互的4种方法
iOS与JS交互的方法: 1.拦截url(适用于UIWebView和WKWebView) 2.JavaScriptCore(只适用于UIWebView,iOS7+) 3.WKScriptMessage ...
- UITableView嵌套WKWebView的那些坑
最近项目中遇到了一个需求,TableView中需要嵌套Web页面,我的解决办法是在系统的UITableViewCell中添加WKWebView.开发的过程中,遇到了些坑,写出来分享一下. 1.首先说一 ...
- WKWebView 的使用简介
1. navigationDelegate [objc] view plaincopy print? - (void)webView:(WKWebView *)webView didStartProv ...
- WKWebView的使用
在WWDC2014中,苹果推出了最新的iOS8系统,其中也伴随着很多控件的更新与升级.其中全新的WebKit库让人很是兴奋.本文也将讲解到WebKit中更新的WKWebView控件的新特性与使用方法, ...
- iOS下JS与OC互相调用(六)--WKWebView + WebViewJavascriptBridge
2019独角兽企业重金招聘Python工程师标准>>> iOS下JS与OC互相调用(六)--WKWebView + WebViewJavascriptBridge 转载:原地址 ht ...
- wkwebview 下移20像素_UITableView嵌套WKWebView的那些坑
原标题:UITableView嵌套WKWebView的那些坑 最近项目中遇到了一个需求,TableView中需要嵌套Web页面,我的解决办法是在系统的UITableViewCell中添加WKWebVi ...
- ios 使用webview 查找_iOS开发WKWebView与JS的交互
iOS8以后,Apple公司推出了WKWebView,对比之前的UIWebView不论是处理速度还是内存性能,都有了大幅度的提升! 那么下面我就分享一下WKWebView与JS的交互. 首先使用WKW ...
- 对 WKWebView js交互的简单封装
文章目录 1.WKWebView使用流程 2.核心方法 3.封装流程 3.1.初始化 3.2.加载URL 3.3.OC与js交互 3.3.1.监听js消息 3.3.2.注入js消息 3.3.3.移除j ...
最新文章
- 在linux中怎么重置mysql密码_详解如何在Linux(CentOS)下重置MySQL根(Root)密码
- OpenCV:使用OpenCV无缝克隆模块的实例(附完整代码)
- 单片机小白学步系列(一) 单片机的前世今生
- NA-NP-IE系列实验28:HDLC 和PPP 封装
- LeetCode 1257. 最小公共区域(最小公共祖先)
- abs 不会整数 方法 溢出_asp cint clng的范围与防止cint和clng的溢出解决方法大全
- 随机游走问题的神奇应用(三)
- 实时监控 轻松玩转IT运维
- 老愤青也来说两句,也谈青年程序员如何进入职场
- viewpager 获取当前现实的view
- eclipse 运行企业进销存管理系统
- 华为笔记本linux好不好,华为笔记本怎么样
- 什么是 Win10 五月更新版?附Win10 1903更新文件下载
- hadoop跨集群之间迁移hive数据
- MAC系统下测试IP+端口
- Docker系列文-----Docker的网络类型(4)
- USB fastboot
- u盘里的文件不见了怎么恢复正常?
- 前端工程师之jquery实战案例大集合-彭亮-专题视频课程
- 用php编写多项选择题_php试题