I use Xcode 7.2 and Swift to create an iOS application, in this application I show the contents of my website, however, if I were offline, the content would not be shown. So I want to cache the webpage and display it offline.
After I declared everything, I use the following code:
var URLPATH="http://google.com"
let requestURL = NSURL(string: URLPATH)
let request = NSURLRequest(URL: requestURL!)
WB.loadRequest(request)
source
share