How to save UIWebView content for offline display?
问题 I'm using Xcode 7.2 and Swift to create an iOS app, on this app I display the content of my website, however if I was offline the content will not be shown. So I want to cache the webpage and display for offline. After I declared everything I'm using the following code : var URLPATH="http://google.com" let requestURL = NSURL(string: URLPATH) let request = NSURLRequest(URL: requestURL!) WB.loadRequest(request) 回答1: HTML to Data if let url = URL(string: urlString) { person.setValue(try? Data