Guest User

Untitled

a guest
Feb 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. func validate(response: CachedURLResponse, for request: URLRequest) -> Bool {
  2. let temporaryCache = URLCache(memoryCapacity: 10000000, diskCapacity: 0, diskPath: nil)
  3.  
  4. request.cachePolicy = .useProtocolCachePolicy
  5. temporaryCache.storeCachedResponse(response, for: request)
  6. return temporaryCache.cachedResponse(for: request) != nil
  7. }
Add Comment
Please, Sign In to add comment