forked from shadowfacts/Tusker
parent
94dc5d3177
commit
f7304a011c
|
@ -81,10 +81,7 @@ class ImageCache {
|
|||
guard !ImageCache.disableCaching else { return }
|
||||
|
||||
if !((try? cache.has(url.absoluteString)) ?? false) {
|
||||
let task = dataTask(url: url) { data, image in
|
||||
guard let data else { return }
|
||||
try? self.cache.set(url.absoluteString, data: data, image: image)
|
||||
}
|
||||
let task = dataTask(url: url, completion: nil)
|
||||
task.resume()
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +92,9 @@ class ImageCache {
|
|||
let data else {
|
||||
return
|
||||
}
|
||||
completion?(data, UIImage(data: data))
|
||||
let image = UIImage(data: data)
|
||||
try? self.cache.set(url.absoluteString, data: data, image: image)
|
||||
completion?(data, image)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue