Previously we are using webview to load local HTML file and evaluate the Json data on it which was working fine but now we are using WKWebview and loading the local HTML file and Evaluating Json data on it but it's loads very slowly comparing to Webview.
Code Snippet for WebView:
NSURL *instructionsURL = [NSURL fileURLWithPath:path];
NSURLRequest *req = [NSURLRequest requestWithURL:instructionsURL];
[self.webViewHistory loadRequest:req];
NSString *js = [NSString stringWithFormat:@"activeDataDisplay(%@)", jsonActivityDataString];
[self.webViewHistory stringByEvaluatingJavaScriptFromString:js];
Code Snippet for WkWebview:
NSURL *instructionsURL = [NSURL fileURLWithPath:path];
NSURLRequest *req = [NSURLRequest requestWithURL:instructionsURL];
[self.wkWebHistory loadRequest:req];
NSString *js = [NSString stringWithFormat:@"activeDataDisplay(%@)", jsonActivityDataString];
[self.wkWebHistory evaluateJavaScript:js completionHandler:^(NSString *result, NSError *error) {
NSLog(@“Completion”);
}];
Any help or workaround for this? or is there any other way? Thanks in Adv.