Skip to content

Commit

Permalink
Merge pull request #177 from najeeb-ur-rehman/fix/DownloadHandler
Browse files Browse the repository at this point in the history
Use the Instance DownloadHandler
  • Loading branch information
JanGorman authored Mar 23, 2020
2 parents edd90f8 + 4104ad7 commit 007c697
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Agrume/Agrume.swift
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ extension Agrume: AgrumeDataSource {
}

public func image(forIndex index: Int, completion: @escaping (UIImage?) -> Void) {
if let handler = AgrumeServiceLocator.shared.downloadHandler, let url = images[index].url {
let downloadHandler = download ?? AgrumeServiceLocator.shared.downloadHandler
if let handler = downloadHandler, let url = images[index].url {
handler(url, completion)
} else if let url = images[index].url {
downloadTask = ImageDownloader.downloadImage(url, completion: completion)
Expand Down

0 comments on commit 007c697

Please sign in to comment.