Skip to content

Commit

Permalink
Consider manager’s downloader and cache in default
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Jun 2, 2017
1 parent c676d71 commit e6a661d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/KingfisherManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public class KingfisherManager {
/// - Note: This option will not be applied to independent using of `ImageDownloader` or `ImageCache`.
public var defaultOptions = KingfisherEmptyOptionsInfo

var currentDefaultOptions: KingfisherOptionsInfo {
return [.downloader(downloader), .targetCache(cache)] + defaultOptions
}

convenience init() {
self.init(downloader: .default, cache: .default)
}
Expand Down Expand Up @@ -117,7 +121,7 @@ public class KingfisherManager {
completionHandler: CompletionHandler?) -> RetrieveImageTask
{
let task = RetrieveImageTask()
let options = defaultOptions + (options ?? KingfisherEmptyOptionsInfo)
let options = currentDefaultOptions + (options ?? KingfisherEmptyOptionsInfo)
if options.forceRefresh {
_ = downloadAndCacheImage(
with: resource.downloadURL,
Expand Down

0 comments on commit e6a661d

Please sign in to comment.