the code is there the WKWebview memory demo
I am working on a keyboard extension project and need integrate WKWebview . but when I close the WKWebview, the memory is not released,
I want the system or webview release the memory immediately,because the keyboard extension only have 66m memory limit.
Here is the code I try to solve this issue:
URLCache.shared.removeAllCachedResponses()
URLCache.shared.diskCapacity = 0
URLCache.shared.memoryCapacity = 0
//set WKWebViewConfiguration
config.websiteDataStore = WKWebsiteDataStore.nonPersistent()
//deinit
deinit {
webView.uiDelegate = nil
webView.navigationDelegate = nil
webView.removeObserver(self, forKeyPath: "estimatedProgress")
webView.configuration.userContentController.removeAllUserScripts()
}

