I have a native segment control that loads predetermined URLs in a WKWebView. What I want to achieve is the WKWebView clearing (is blank) between loads.
So right before I fired off the real request, I tried to load:
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]];
[wkWebView loadRequest:request];
I even tried to load some empty HTML to no avail:
[wkWebView loadHTMLString:@"<html><body></body></html>" baseURL:[NSURL URLWithString:@"about:blank"]];
This does work for UIWebView. Any tips on this one?
It's possible via delegates. Just hide your webview before each request and turn it visible after load completion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With