WKWebView

WKWebView是蘋果在iOS 8之后推出的框架WebKit中的瀏覽器控件, 其加載速度比UIWebView快了許多, 但內(nèi)存占用率卻下降很多, 也解決了加載網(wǎng)頁(yè)時(shí)的內(nèi)存泄露問(wèn)題. 現(xiàn)在的項(xiàng)目大多數(shù)只需適配到iOS 8, 所以用WKWebView來(lái)替換項(xiàng)目中的UIWebView是很有必要的.

WKWebView的使用主要涉及下面幾個(gè)類:

WKWebView

WKWebViewConfiguration

WKUserScript

WKUserContentController

WKWebsiteDataStore

以及兩個(gè)代理:

WKNavigationDelegate

WKUIDelegate

1. WKWebView

1.1 常用屬性

// 導(dǎo)航代理@property(nullable,nonatomic,weak)id navigationDelegate;// UI代理@property(nullable,nonatomic,weak)idUIDelegate;// 頁(yè)面標(biāo)題, 一般使用KVO動(dòng)態(tài)獲取@property(nullable,nonatomic,readonly,copy)NSString*title;// 頁(yè)面加載進(jìn)度, 一般使用KVO動(dòng)態(tài)獲取@property(nonatomic,readonly)doubleestimatedProgress;// 可返回的頁(yè)面列表, 已打開過(guò)的網(wǎng)頁(yè), 有點(diǎn)類似于navigationController的viewControllers屬性@property(nonatomic,readonly,strong)WKBackForwardList*backForwardList;// 頁(yè)面url@property(nullable,nonatomic,readonly,copy)NSURL*URL;// 頁(yè)面是否在加載中@property(nonatomic,readonly,getter=isLoading)BOOLloading;// 是否可返回@property(nonatomic,readonly)BOOLcanGoBack;// 是否可向前@property(nonatomic,readonly)BOOLcanGoForward;// WKWebView繼承自UIView, 所以如果想設(shè)置scrollView的一些屬性, 需要對(duì)此屬性進(jìn)行配置@property(nonatomic,readonly,strong)UIScrollView*scrollView;// 是否允許手勢(shì)左滑返回上一級(jí), 類似導(dǎo)航控制的左滑返回@property(nonatomic)BOOLallowsBackForwardNavigationGestures;//自定義UserAgent, 會(huì)覆蓋默認(rèn)的值 ,iOS 9之后有效@property(nullable,nonatomic,copy)NSString*customUserAgent

1.2 一些方法:

// 帶配置信息的初始化方法// configuration 配置信息- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration*)configuration// 加載請(qǐng)求- (nullableWKNavigation*)loadRequest:(NSURLRequest*)request;// 加載HTML- (nullableWKNavigation*)loadHTMLString:(NSString*)string baseURL:(nullableNSURL*)baseURL;// 返回上一級(jí)- (nullableWKNavigation*)goBack;// 前進(jìn)下一級(jí), 需要曾經(jīng)打開過(guò), 才能前進(jìn)- (nullableWKNavigation*)goForward;// 刷新頁(yè)面- (nullableWKNavigation*)reload;// 根據(jù)緩存有效期來(lái)刷新頁(yè)面- (nullableWKNavigation*)reloadFromOrigin;// 停止加載頁(yè)面- (void)stopLoading;// 執(zhí)行JavaScript代碼- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void(^ _Nullable)(_Nullableid,NSError* _Nullable error))completionHandler;

2. WKWebViewConfiguration

// 通過(guò)此屬性來(lái)執(zhí)行JavaScript代碼來(lái)修改頁(yè)面的行為@property(nonatomic,strong)WKUserContentController*userContentController;//***********下面屬性一般不需要設(shè)置// 首選項(xiàng)設(shè)置,? //可設(shè)置最小字號(hào), 是否允許執(zhí)行js//是否通過(guò)js自動(dòng)打開新的窗口@property(nonatomic,strong)WKPreferences*preferences;// 是否允許播放媒體文件@property(nonatomic)BOOLallowsAirPlayForMediaPlayback// 需要用戶來(lái)操作才能播放的多媒體類型@property(nonatomic)WKAudiovisualMediaTypesmediaTypesRequiringUserActionForPlayback// 是使用h5的視頻播放器在線播放, 還是使用原生播放器全屏播放@property(nonatomic)BOOLallowsInlineMediaPlayback;

3. WKUserContentController

WKUserContentController 是JavaScript與原生進(jìn)行交互的橋梁, 主要使用的方法有:

// 注入JavaScript與原生交互協(xié)議// JS 端可通過(guò) window.webkit.messageHandlers..postMessage() 發(fā)送消息- (void)addScriptMessageHandler:(id)scriptMessageHandler name:(NSString*)name;// 移除注入的協(xié)議, 在deinit方法中調(diào)用- (void)removeScriptMessageHandlerForName:(NSString*)name;// 通過(guò)WKUserScript注入需要執(zhí)行的JavaScript代碼- (void)addUserScript:(WKUserScript*)userScript;// 移除所有注入的JavaScript代碼- (void)removeAllUserScripts;

使用WKUserContentController注入的交互協(xié)議, 需要遵循WKScriptMessageHandler協(xié)議, 在其協(xié)議方法中獲取JavaScript端傳遞的事件和參數(shù):

- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message;

WKScriptMessage包含了傳遞的協(xié)議名稱及參數(shù), 主要從下面的屬性中獲取:

// 協(xié)議名稱, 即上面的add方法傳遞的name@property(nonatomic,readonly,copy)NSString*name;// 傳遞的參數(shù)@property(nonatomic,readonly,copy)idbody;

4. WKUserScript

WKUserScript用于往加載的頁(yè)面中添加額外需要執(zhí)行的JavaScript代碼, 主要是一個(gè)初始化方法:

/*

source: 需要執(zhí)行的JavaScript代碼

injectionTime: 加入的位置, 是一個(gè)枚舉

typedef NS_ENUM(NSInteger, WKUserScriptInjectionTime) {

? ? WKUserScriptInjectionTimeAtDocumentStart,

? ? WKUserScriptInjectionTimeAtDocumentEnd

} API_AVAILABLE(macosx(10.10), ios(8.0));

forMainFrameOnly: 是加入所有框架, 還是只加入主框架

*/- (instancetype)initWithSource:(NSString*)source injectionTime:(WKUserScriptInjectionTime)injectionTime forMainFrameOnly:(BOOL)forMainFrameOnly;

5. WKUIDelegate

這個(gè)代理方法, 主要是用來(lái)處理使用系統(tǒng)的彈框來(lái)替換JS中的一些彈框的,比如: 警告框, 選擇框, 輸入框, 主要使用的是下面三個(gè)代理方法:

/**

webView中彈出警告框時(shí)調(diào)用, 只能有一個(gè)按鈕

@param webView webView

@param message 提示信息

@param frame 可用于區(qū)分哪個(gè)窗口調(diào)用的

@param completionHandler 警告框消失的時(shí)候調(diào)用, 回調(diào)給JS

*/- (void)webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void(^)(void))completionHandler {UIAlertController*alert = [UIAlertControlleralertControllerWithTitle:@"警告"message:message preferredStyle:(UIAlertControllerStyleAlert)];UIAlertAction*ok = [UIAlertActionactionWithTitle:@"我知道了"style:(UIAlertActionStyleDefault) handler:^(UIAlertAction* _Nonnull action) {? ? ? ? completionHandler();? ? }];? ? ? ? [alert addAction:ok];? ? [selfpresentViewController:alert animated:YEScompletion:nil];}/** 對(duì)應(yīng)js的confirm方法

webView中彈出選擇框時(shí)調(diào)用, 兩個(gè)按鈕

@param webView webView description

@param message 提示信息

@param frame 可用于區(qū)分哪個(gè)窗口調(diào)用的

@param completionHandler 確認(rèn)框消失的時(shí)候調(diào)用, 回調(diào)給JS, 參數(shù)為選擇結(jié)果: YES or NO

*/- (void)webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void(^)(BOOLresult))completionHandler {UIAlertController*alert = [UIAlertControlleralertControllerWithTitle:@"請(qǐng)選擇"message:message preferredStyle:(UIAlertControllerStyleAlert)];UIAlertAction*ok = [UIAlertActionactionWithTitle:@"同意"style:(UIAlertActionStyleDefault) handler:^(UIAlertAction* _Nonnull action) {? ? ? ? completionHandler(YES);? ? }];UIAlertAction*cancel = [UIAlertActionactionWithTitle:@"不同意"style:(UIAlertActionStyleCancel) handler:^(UIAlertAction* _Nonnull action) {? ? ? ? completionHandler(NO);? ? }];? ? ? ? [alert addAction:ok];? ? [alert addAction:cancel];? ? [selfpresentViewController:alert animated:YEScompletion:nil];}/** 對(duì)應(yīng)js的prompt方法

webView中彈出輸入框時(shí)調(diào)用, 兩個(gè)按鈕 和 一個(gè)輸入框

@param webView webView description

@param prompt 提示信息

@param defaultText 默認(rèn)提示文本

@param frame 可用于區(qū)分哪個(gè)窗口調(diào)用的

@param completionHandler 輸入框消失的時(shí)候調(diào)用, 回調(diào)給JS, 參數(shù)為輸入的內(nèi)容

*/- (void)webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt defaultText:(nullableNSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void(^)(NSString* _Nullable result))completionHandler {UIAlertController*alert = [UIAlertControlleralertControllerWithTitle:@"請(qǐng)輸入"message:prompt preferredStyle:(UIAlertControllerStyleAlert)];? ? ? ? [alert addTextFieldWithConfigurationHandler:^(UITextField* _Nonnull textField) {? ? ? ? textField.placeholder =@"請(qǐng)輸入";? ? }];UIAlertAction*ok = [UIAlertActionactionWithTitle:@"確定"style:(UIAlertActionStyleDefault) handler:^(UIAlertAction* _Nonnull action) {UITextField*tf = [alert.textFields firstObject];? ? ? ? ? ? ? ? ? ? ? ? completionHandler(tf.text);? ? }];UIAlertAction*cancel = [UIAlertActionactionWithTitle:@"取消"style:(UIAlertActionStyleCancel) handler:^(UIAlertAction* _Nonnull action) {? ? ? ? ? ? ? ? completionHandler(defaultText);? ? }];? ? ? ? [alert addAction:ok];? ? [alert addAction:cancel];? ? [selfpresentViewController:alert animated:YEScompletion:nil];}

6. WKNavigationDelegate

// 決定導(dǎo)航的動(dòng)作,通常用于處理跨域的鏈接能否導(dǎo)航。// WebKit對(duì)跨域進(jìn)行了安全檢查限制掘鄙,不允許跨域,因此我們要對(duì)不能跨域的鏈接單獨(dú)處理祷舀。// 但是,對(duì)于Safari是允許跨域的烹笔,不用這么處理裳扯。// 這個(gè)是決定是否Request- (void)webView:(WKWebView*)webView decidePolicyForNavigationAction:(WKNavigationAction*)navigationAction decisionHandler:(void(^)(WKNavigationActionPolicy))decisionHandler{//? 在發(fā)送請(qǐng)求之前,決定是否跳轉(zhuǎn)decisionHandler(WKNavigationActionPolicyAllow);? }// 是否接收響應(yīng)- (void)webView:(WKWebView*)webView decidePolicyForNavigationResponse:(WKNavigationResponse*)navigationResponse decisionHandler:(void(^)(WKNavigationResponsePolicy))decisionHandler{// 在收到響應(yīng)后谤职,決定是否跳轉(zhuǎn)和發(fā)送請(qǐng)求之前那個(gè)允許配套使用decisionHandler(WKNavigationResponsePolicyAllow);}//用于授權(quán)驗(yàn)證的API饰豺,與AFN、UIWebView的授權(quán)驗(yàn)證API是一樣的- (void)webView:(WKWebView*)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge*)challenge completionHandler:(void(^)(NSURLSessionAuthChallengeDispositiondisposition,NSURLCredential*__nullablecredential))completionHandler{? ? ? ? completionHandler(NSURLSessionAuthChallengePerformDefaultHandling,nil);}// main frame的導(dǎo)航開始請(qǐng)求時(shí)調(diào)用- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(null_unspecifiedWKNavigation*)navigation{? }// 當(dāng)main frame接收到服務(wù)重定向時(shí)調(diào)用- (void)webView:(WKWebView*)webView didReceiveServerRedirectForProvisionalNavigation:(null_unspecifiedWKNavigation*)navigation{// 接收到服務(wù)器跳轉(zhuǎn)請(qǐng)求之后調(diào)用}// 當(dāng)main frame開始加載數(shù)據(jù)失敗時(shí)允蜈,會(huì)回調(diào)- (void)webView:(WKWebView*)webView didFailProvisionalNavigation:(null_unspecifiedWKNavigation*)navigation withError:(NSError*)error {}// 當(dāng)內(nèi)容開始返回時(shí)調(diào)用- (void)webView:(WKWebView*)webView didCommitNavigation:(null_unspecifiedWKNavigation*)navigation{? }//當(dāng)main frame導(dǎo)航完成時(shí)冤吨,會(huì)回調(diào)- (void)webView:(WKWebView*)webView didFinishNavigation:(null_unspecifiedWKNavigation*)navigation{// 頁(yè)面加載完成之后調(diào)用}// 當(dāng)main frame最后下載數(shù)據(jù)失敗時(shí),會(huì)回調(diào)- (void)webView:(WKWebView*)webView didFailNavigation:(null_unspecifiedWKNavigation*)navigation withError:(NSError*)error {}// 當(dāng)web content處理完成時(shí)饶套,會(huì)回調(diào)- (void)webViewWebContentProcessDidTerminate:(WKWebView*)webView {}

7. WKWebsiteDataStore

WKWebsiteDataStore提供了網(wǎng)站所能使用的數(shù)據(jù)類型漩蟆,包括 cookies,硬盤緩存妓蛮,內(nèi)存緩存活在一些WebSQL的數(shù)據(jù)持久化和本地持久化爆安。可通過(guò) ** WKWebViewConfiguration類的屬性 websiteDataStore 進(jìn)行相關(guān)的設(shè)置仔引。WKWebsiteDataStore** 相關(guān)的API也比較簡(jiǎn)單:

// 默認(rèn)的data store+ (WKWebsiteDataStore*)defaultDataStore;// 如果為webView設(shè)置了這個(gè)data Store扔仓,則不會(huì)有數(shù)據(jù)緩存被寫入文件// 當(dāng)需要實(shí)現(xiàn)隱私瀏覽的時(shí)候,可使用這個(gè)+ (WKWebsiteDataStore*)nonPersistentDataStore;// 是否是可緩存數(shù)據(jù)的咖耘,只讀@property(nonatomic,readonly,getter=isPersistent)BOOLpersistent;// 獲取所有可使用的數(shù)據(jù)類型+ (NSSet *)allWebsiteDataTypes;// 查找指定類型的緩存數(shù)據(jù)// 回調(diào)的值是WKWebsiteDataRecord的集合- (void)fetchDataRecordsOfTypes:(NSSet *)dataTypes completionHandler:(void(^)(NSArray *))completionHandler;// 刪除指定的紀(jì)錄// 這里的參數(shù)是通過(guò)上面的方法查找到的WKWebsiteDataRecord實(shí)例獲取的- (void)removeDataOfTypes:(NSSet *)dataTypes forDataRecords:(NSArray *)dataRecords completionHandler:(void(^)(void))completionHandler;// 刪除某時(shí)間后修改的某類型的數(shù)據(jù)- (void)removeDataOfTypes:(NSSet *)websiteDataTypes modifiedSince:(NSDate*)date completionHandler:(void(^)(void))completionHandler;// 保存的HTTP cookies@property(nonatomic,readonly)WKHTTPCookieStore*httpCookieStore

dataTyle

// 硬盤緩存WKWebsiteDataTypeDiskCache,// HTML離線web應(yīng)用程序緩存WKWebsiteDataTypeOfflineWebApplicationCache,// 內(nèi)存緩存WKWebsiteDataTypeMemoryCache,// 本地緩存WKWebsiteDataTypeLocalStorage,// cookiesWKWebsiteDataTypeCookies,// HTML會(huì)話存儲(chǔ)WKWebsiteDataTypeSessionStorage,//? IndexedDB 數(shù)據(jù)庫(kù)WKWebsiteDataTypeIndexedDBDatabases,// WebSQL 數(shù)據(jù)庫(kù)WKWebsiteDataTypeWebSQLDatabases

WKWebsiteDataRecord

// 展示名稱, 通常是域名@property(nonatomic,readonly,copy)NSString*displayName;// 包含的數(shù)據(jù)類型@property(nonatomic,readonly,copy)NSSet *dataTypes;

簡(jiǎn)單應(yīng)用

刪除指定時(shí)間的所有類型數(shù)據(jù)

NSSet*websiteDataTypes = [WKWebsiteDataStoreallWebsiteDataTypes];NSDate*dateFrom = [NSDatedateWithTimeIntervalSince1970:0];? ? [[WKWebsiteDataStoredefaultDataStore] removeDataOfTypes:websiteDataTypes modifiedSince:dateFrom completionHandler:^{// DoneNSLog(@"釋放");? ? }];

查找刪除

WKWebsiteDataStore*dataStore = [WKWebsiteDataStoredefaultDataStore];? ? [dataStore fetchDataRecordsOfTypes:[WKWebsiteDataStoreallWebsiteDataTypes] completionHandler:^(NSArray * _Nonnull records) {for(WKWebsiteDataRecord*recordinrecords) {? ? ? ? ? ? [dataStore removeDataOfTypes:record.dataTypes forDataRecords:@[record] completionHandler:^{// done}];? ? ? ? }? ? }];

查找刪除特定的內(nèi)容

WKWebsiteDataStore*dataStore = [WKWebsiteDataStoredefaultDataStore];? ? [dataStore fetchDataRecordsOfTypes:[WKWebsiteDataStoreallWebsiteDataTypes] completionHandler:^(NSArray * _Nonnull records) {for(WKWebsiteDataRecord*recordinrecords) {if([record.displayName isEqualToString:@"baidu"]) {? ? ? ? ? ? ? ? [dataStore removeDataOfTypes:record.dataTypes forDataRecords:@[record] completionHandler:^{// done}];? ? ? ? ? ? }? ? ? ? }? ? }];

來(lái)自:流火緋瞳? 鏈接:http://www.reibang.com/p/833448c30d70

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末翘簇,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子儿倒,更是在濱河造成了極大的恐慌版保,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,640評(píng)論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件夫否,死亡現(xiàn)場(chǎng)離奇詭異彻犁,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī)凰慈,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,254評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門汞幢,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人微谓,你說(shuō)我怎么就攤上這事森篷。” “怎么了豺型?”我有些...
    開封第一講書人閱讀 165,011評(píng)論 0 355
  • 文/不壞的土叔 我叫張陵仲智,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我姻氨,道長(zhǎng)钓辆,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,755評(píng)論 1 294
  • 正文 為了忘掉前任肴焊,我火速辦了婚禮前联,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘抖韩。我一直安慰自己蛀恩,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,774評(píng)論 6 392
  • 文/花漫 我一把揭開白布茂浮。 她就那樣靜靜地躺著双谆,像睡著了一般。 火紅的嫁衣襯著肌膚如雪席揽。 梳的紋絲不亂的頭發(fā)上顽馋,一...
    開封第一講書人閱讀 51,610評(píng)論 1 305
  • 那天,我揣著相機(jī)與錄音幌羞,去河邊找鬼寸谜。 笑死,一個(gè)胖子當(dāng)著我的面吹牛属桦,可吹牛的內(nèi)容都是我干的熊痴。 我是一名探鬼主播他爸,決...
    沈念sama閱讀 40,352評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼果善!你這毒婦竟也來(lái)了诊笤?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,257評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤巾陕,失蹤者是張志新(化名)和其女友劉穎讨跟,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體鄙煤,經(jīng)...
    沈念sama閱讀 45,717評(píng)論 1 315
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡晾匠,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,894評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了梯刚。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片凉馆。...
    茶點(diǎn)故事閱讀 40,021評(píng)論 1 350
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖乾巧,靈堂內(nèi)的尸體忽然破棺而出句喜,到底是詐尸還是另有隱情,我是刑警寧澤沟于,帶...
    沈念sama閱讀 35,735評(píng)論 5 346
  • 正文 年R本政府宣布咳胃,位于F島的核電站,受9級(jí)特大地震影響旷太,放射性物質(zhì)發(fā)生泄漏展懈。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,354評(píng)論 3 330
  • 文/蒙蒙 一供璧、第九天 我趴在偏房一處隱蔽的房頂上張望存崖。 院中可真熱鬧,春花似錦睡毒、人聲如沸来惧。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,936評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)供搀。三九已至,卻和暖如春钠至,著一層夾襖步出監(jiān)牢的瞬間葛虐,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,054評(píng)論 1 270
  • 我被黑心中介騙來(lái)泰國(guó)打工棉钧, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留屿脐,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,224評(píng)論 3 371
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像的诵,于是被迫代替她去往敵國(guó)和親万栅。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,974評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容

  • 前言 關(guān)于UIWebView的介紹奢驯,相信看過(guò)上文的小伙伴們申钩,已經(jīng)大概清楚了吧,如果有問(wèn)題瘪阁,歡迎提問(wèn)。 本文是本系列...
    CoderLF閱讀 8,968評(píng)論 2 12
  • 前言 給大家介紹另外一種基于 iOS 8 新推出的 WKWebView 組件邮偎,構(gòu)建出自己的混合開發(fā)框架管跺。 WKWe...
    iwolfox閱讀 1,125評(píng)論 1 3
  • WKWebView是在Apple的WWDC 2014隨iOS 8和OS X 10.10出來(lái)的,是為了解決UIWeb...
    zhYx_閱讀 22,670評(píng)論 4 19
  • WKWebView 看看WKWebView的頭文件聲明: WKWebView // webview 配置禾进,具體看下...
    2897275c8a00閱讀 594評(píng)論 0 3
  • 女兒今年4歲泻云,是我獨(dú)自帶大艇拍,單身時(shí)的火爆脾氣因帶娃被磨的棱角全無(wú),但也失控過(guò)宠纯,朝她發(fā)過(guò)脾氣動(dòng)過(guò)手卸夕,都是在她三歲時(shí)。...
    二王子閱讀 363評(píng)論 10 7