|
|
@@ -247,33 +247,33 @@ open class ImageDownloader: NSObject {
|
|
|
barrierQueue.sync { fetchLoad = fetchLoads[url] }
|
|
|
return fetchLoad
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-// MARK: - Download method
|
|
|
-extension ImageDownloader {
|
|
|
- /**
|
|
|
- Download an image with a URL and option.
|
|
|
|
|
|
- - parameter url: Target URL.
|
|
|
- - parameter options: The options could control download behavior. See `KingfisherOptionsInfo`.
|
|
|
- - parameter progressBlock: Called when the download progress updated.
|
|
|
- - parameter completionHandler: Called when the download progress finishes.
|
|
|
-
|
|
|
- - returns: A downloading task. You could call `cancel` on it to stop the downloading process.
|
|
|
- */
|
|
|
+ /**
|
|
|
+ Download an image with a URL and option.
|
|
|
+
|
|
|
+ - parameter url: Target URL.
|
|
|
+ - parameter options: The options could control download behavior. See `KingfisherOptionsInfo`.
|
|
|
+ - parameter progressBlock: Called when the download progress updated.
|
|
|
+ - parameter completionHandler: Called when the download progress finishes.
|
|
|
+
|
|
|
+ - returns: A downloading task. You could call `cancel` on it to stop the downloading process.
|
|
|
+ */
|
|
|
@discardableResult
|
|
|
open func downloadImage(with url: URL,
|
|
|
- options: KingfisherOptionsInfo? = nil,
|
|
|
- progressBlock: ImageDownloaderProgressBlock? = nil,
|
|
|
- completionHandler: ImageDownloaderCompletionHandler? = nil) -> RetrieveImageDownloadTask?
|
|
|
+ options: KingfisherOptionsInfo? = nil,
|
|
|
+ progressBlock: ImageDownloaderProgressBlock? = nil,
|
|
|
+ completionHandler: ImageDownloaderCompletionHandler? = nil) -> RetrieveImageDownloadTask?
|
|
|
{
|
|
|
return downloadImage(with: url,
|
|
|
- retrieveImageTask: nil,
|
|
|
- options: options,
|
|
|
- progressBlock: progressBlock,
|
|
|
- completionHandler: completionHandler)
|
|
|
+ retrieveImageTask: nil,
|
|
|
+ options: options,
|
|
|
+ progressBlock: progressBlock,
|
|
|
+ completionHandler: completionHandler)
|
|
|
}
|
|
|
-
|
|
|
+}
|
|
|
+
|
|
|
+// MARK: - Download method
|
|
|
+extension ImageDownloader {
|
|
|
func downloadImage(with url: URL,
|
|
|
retrieveImageTask: RetrieveImageTask?,
|
|
|
options: KingfisherOptionsInfo?,
|