Reputation: 6752
I don't really want a timeoutInterval so cache will always be available when offline, but I can't leave it out either. Is there a way to set it to unlimited?
var requestObj = NSURLRequest(URL: url!, cachePolicy: NSURLRequestCachePolicy.ReturnCacheDataElseLoad, timeoutInterval: 5);
Upvotes: 1
Views: 1141
Reputation: 111
var requestObj = NSURLRequest(URL: url!, cachePolicy: NSURLRequestCachePolicy.ReturnCacheDataElseLoad, timeoutInterval: Double.greatestFiniteMagnitude)
Upvotes: 0
Reputation: 8184
Simple
var requestObj = NSURLRequest(URL: url!, cachePolicy: NSURLRequestCachePolicy.ReturnCacheDataElseLoad, timeoutInterval: Double.infinity);
Upvotes: 3