I am trying to cache my UIWebView for when I have no network connection but it doesn't work. I tried looking into HanekeSwift but that only works with JSON requests as far as I could find.
This is what I currently have:
override func viewDidLoad() {
super.viewDidLoad()
let id = NSUserDefaults.standardUserDefaults().objectForKey("id") as! String
let url = NSURL (string: "http://****.php?id=\(id)");
let requestObj = NSURLRequest(URL: url!);
subtitleLabel.loadRequest(requestObj);
}
requestObj
with specific cache policyReturnCacheDataDontLoad
if you can tell there is no network, or use the default behavior.0x196a994c8 <+28>: ldr x9, [x19] WebThread (6): EXC_BAD_ACCESS (code =1, address=0x8)