Просмотр исходного кода

Merge branch 'master' into feature/default-option

# Conflicts:
#	Sources/ImageDownloader.swift
onevcat 8 лет назад
Родитель
Сommit
bfc51d2488
1 измененных файлов с 12 добавлено и 3 удалено
  1. 12 3
      Sources/ImageDownloader.swift

+ 12 - 3
Sources/ImageDownloader.swift

@@ -203,7 +203,7 @@ open class ImageDownloader {
     }
     
     /// Whether the download requests should use pipeling or not. Default is false.
-    open var requestsUsePipeling = false
+    open var requestsUsePipelining = false
     
     fileprivate let sessionHandler: ImageDownloaderSessionHandler
     fileprivate var session: URLSession?
@@ -282,8 +282,8 @@ open class ImageDownloader {
         
         // We need to set the URL as the load key. So before setup progress, we need to ask the `requestModifier` for a final URL.
         var request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: timeout)
-        request.httpShouldUsePipelining = requestsUsePipeling
-        
+        request.httpShouldUsePipelining = requestsUsePipelining
+
         if let modifier = options?.modifier {
             guard let r = modifier.modified(for: request) else {
                 completionHandler?(nil, NSError(domain: KingfisherErrorDomain, code: KingfisherError.downloadCancelledBeforeStarting.rawValue, userInfo: nil), nil, nil)
@@ -531,3 +531,12 @@ class ImageDownloaderSessionHandler: NSObject, URLSessionDataDelegate, Authentic
 
 // Placeholder. For retrieving extension methods of ImageDownloaderDelegate
 extension ImageDownloader: ImageDownloaderDelegate {}
+
+// MARK: - Deprecated
+extension ImageDownloader {
+    @available(*, deprecated, message: "`requestsUsePipeling` is deprecated. Use `requestsUsePipelining` instead", renamed: "requestsUsePipelining")
+    open var requestsUsePipeling: Bool {
+        get { return requestsUsePipelining }
+        set { requestsUsePipelining = newValue }
+    }
+}