Browse Source

replace shouldPreloadAllGIF() with base.shouldPreloadAllGIF()

xspyhack 9 years ago
parent
commit
42204ba68f
1 changed files with 5 additions and 7 deletions
  1. 5 7
      Sources/ImageView+Kingfisher.swift

+ 5 - 7
Sources/ImageView+Kingfisher.swift

@@ -74,7 +74,7 @@ extension Kingfisher where Base: ImageView {
         
         
         setWebURL(resource.downloadURL)
         setWebURL(resource.downloadURL)
 
 
-        if shouldPreloadAllGIF() {
+        if base.shouldPreloadAllGIF() {
             options.append(.preloadAllGIFData)
             options.append(.preloadAllGIFData)
         }
         }
         
         
@@ -138,10 +138,6 @@ extension Kingfisher where Base: ImageView {
     public func cancelDownloadTask() {
     public func cancelDownloadTask() {
         imageTask?.downloadTask?.cancel()
         imageTask?.downloadTask?.cancel()
     }
     }
-    
-    func shouldPreloadAllGIF() -> Bool {
-        return true
-    }
 }
 }
 
 
 // MARK: - Associated Object
 // MARK: - Associated Object
@@ -285,6 +281,8 @@ extension ImageView {
     fileprivate func kf_setImageTask(_ task: RetrieveImageTask?) { kf.setImageTask(task) }
     fileprivate func kf_setImageTask(_ task: RetrieveImageTask?) { kf.setImageTask(task) }
     @available(*, deprecated, message: "Extensions directly on image views are deprecated.", renamed: "kf.setWebURL")
     @available(*, deprecated, message: "Extensions directly on image views are deprecated.", renamed: "kf.setWebURL")
     fileprivate func kf_setWebURL(_ url: URL) { kf.setWebURL(url) }
     fileprivate func kf_setWebURL(_ url: URL) { kf.setWebURL(url) }
-    @available(*, deprecated, message: "Extensions directly on image views are deprecated.", renamed: "kf.shouldPreloadAllGIF")
-    func shouldPreloadAllGIF() -> Bool { return kf.shouldPreloadAllGIF() }
+}
+
+extension ImageView {
+    func shouldPreloadAllGIF() -> Bool { return true }
 }
 }