Marion Barker 2 лет назад
Родитель
Сommit
021151cbdf
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      LoopFollow/ViewControllers/NightScoutViewController.swift

+ 4 - 3
LoopFollow/ViewControllers/NightScoutViewController.swift

@@ -64,11 +64,12 @@ class NightscoutViewController: UIViewController {
     // New code to clear web cache
     func clearWebCache() {
         let dataStore = WKWebsiteDataStore.default()
+        let cacheTypes = Set([WKWebsiteDataTypeDiskCache, WKWebsiteDataTypeMemoryCache])
         let date = Date(timeIntervalSince1970: 0)
-        dataStore.removeData(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes(), modifiedSince: date) {
-            print("Web cache cleared.")
+        dataStore.removeData(ofTypes: cacheTypes, modifiedSince: date) {
+          print(“Web cache cleared.“)
         }
-    }
+      }
     
     // this handles target=_blank links by opening them in the same view
     func webView(webView: WKWebView!, createWebViewWithConfiguration configuration: WKWebViewConfiguration!, forNavigationAction navigationAction: WKNavigationAction!, windowFeatures: WKWindowFeatures!) -> WKWebView! {