I need UIWebView to display some local .webarchive file. But images there have same names, so UIWebView shows only one image all the time. How can I clear the cache?
For swift 3
//to remove cache from UIWebview
URLCache.shared.removeAllCachedResponses()
if let cookies = HTTPCookieStorage.shared.cookies {
for cookie in cookies {
HTTPCookieStorage.shared.deleteCookie(cookie)
}
}
// Flush all cached data
[[NSURLCache sharedURLCache] removeAllCachedResponses];
NSURLRequest* request = [NSURLRequest requestWithURL:fileURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];
[webView loadRequest:request];
(now with typo fixed)