I am trying to replace deprecated UIWebView with WKWebView. But during implementation I found out that WKWebView's loadData is not working properly and shows blank page when trying to render XML data which is encoded into UTF8. I have xsl transformation files in my Xcode project directory.
NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];
NSData *xmlData = [self.invoiceXML dataUsingEncoding:NSUTF8StringEncoding];
[_webView loadData:xmlData MIMEType:@"text/xml" characterEncodingName:@"utf-8" baseURL:baseURL];
Previous working function with UIWebView
[_webView loadData:xmlData MIMEType:@"text/xml" textEncodingName:@"utf-8" baseURL:baseURL];