5
votes

I have UIWebView, WKWebView and loadHTMLString:baseURL: to load local HTML but wkWebView is slower than UIWebVIew. What is the reason? How can I improve the rendering speed?

3

3 Answers

3
votes

Yes, I have the problem too. there is a solution by Timur Bernikowich: https://github.com/bernikowich/NSTViewWarmuper

But, WKWebView is also slower than UIWebView with using loadHTMLString:baseURL: method.

For more see here: https://stackoverflow.com/a/42109186/5557953

0
votes

Short but adequate solution: Disable phone number data detectors for you WKWebView (enabled by default if you use Storyboard).

https://stackoverflow.com/a/53527592/1683141

0
votes

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]