I have a UIWebView inside my app. This UIWebView needs to be reloaded fully (i.e. clear all cache of images/HTML/cookies etc.) every time when viewDidLoad.
URLCache.shared.removeAllCachedResponses()
URLCache.shared.diskCapacity = 0
URLCache.shared.memoryCapacity = 0
if let cookies = HTTPCookieStorage.shared.cookies {
for cookie in cookies {
HTTPCookieStorage.shared.deleteCookie(cookie)
}
}