UIWebView VS WKWebView to load local html

后端 未结 4 1070
梦如初夏
梦如初夏 2020-12-11 23:14

i create a html string with 500 p tag with timestamp in it

i use UIWebView and WKWebView loadHTMLString:baseURL: to load it,and wkWeb

4条回答
  •  借酒劲吻你
    2020-12-11 23:49

    To make WKWebView faster, disabling WKWebView's data detectors worked for me. Swift version:

    let webViewCofig = WKWebViewConfiguration()
    webViewCofig.dataDetectorTypes = []
    webView = WKWebView(frame: view.frame, configuration: webViewCofig)
    

    To enable specific data detector, pass the specific type as .address,.link etc while setting dataDetectorTypes:

    config.dataDetectorTypes = [.address]
    

提交回复
热议问题