LoadData: MIMEType: textEncodingName: baseURL: in WKWebView

I would like to use WKWebView instead of UIWebView to display data on iOS. However, it seems that loadData: MIMEType: textEncodingName: baseURL: has been removed in WKWebView.

Is there any way to simulate this functionality in WKWEbView?

Thank!

+4
source share
2 answers

You can convert NSData to NSString and use loadHTMLString:baseURL:( API Docs ).

However, this method has problems with the base file system URLs in the latest beta: WKWebView does not work in iOS 8 beta 4 .

+3

iOS 9.0 WKWebView :

- loadData:MIMEType:characterEncodingName:baseURL:

, (MS Word), UIWebView, WKWebView.

+1

All Articles