2

According to sources (1,2)

The below category that uses private API usually found in Safari lets WkWebView enable Application cache

@interface WKPreferences (MyPreferences)
- (void)_setOfflineApplicationCacheIsEnabled:(BOOL)offlineApplicationCacheIsEnabled;
@end

I wanted to implement application cache using Swift so I made the conversion of above code

extension WKPreferences {
    func _setOfflineApplicationCacheIsEnabled(offlineApplicationCacheIsEnabled: Bool) {
    }
}

But in swift its not working.

Here is the sample url that has application cache.I tried this in safari it works perfectly but not in WkWebView

Community
  • 1
  • 1
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241

1 Answers1

2

you should import the ObjC version you have above into your bridging file. then in swift call the now exposed method directly.

Casey
  • 6,531
  • 24
  • 43