Parcourir la source

Add a default case and rename keep case

onevcat il y a 3 ans
Parent
commit
6895d6f19e

+ 2 - 1
Sources/General/KingfisherManager.swift

@@ -234,7 +234,8 @@ public class KingfisherManager {
                 return
                 return
             }
             }
             switch strategy {
             switch strategy {
-            case .keep: setter(image)
+            case .default: setter(image)
+            case .keepCurrent: break
             case .replace(let newImage): setter(newImage)
             case .replace(let newImage): setter(newImage)
             }
             }
         }) {
         }) {

+ 4 - 2
Sources/Image/ImageProgressive.swift

@@ -34,11 +34,13 @@ public struct ImageProgressive {
     
     
     /// The updating strategy when an intermediate progressive image is generated and about to be set to the hosting view.
     /// The updating strategy when an intermediate progressive image is generated and about to be set to the hosting view.
     ///
     ///
-    /// - keep: Do not change the received intermediate progressive image. Just use as it is.
+    /// - default: Use the progressive image as it is. It is the standard behavior when handling the progressive image.
+    /// - keepCurrent: Discard this progressive image and keep the current displayed one.
     /// - replace: Replace the image to a new one. If the progressive loading is initialized by a view extension in
     /// - replace: Replace the image to a new one. If the progressive loading is initialized by a view extension in
     ///            Kingfisher, the replacing image will be used to update the view.
     ///            Kingfisher, the replacing image will be used to update the view.
     public enum UpdatingStrategy {
     public enum UpdatingStrategy {
-        case keep
+        case `default`
+        case keepCurrent
         case replace(KFCrossPlatformImage?)
         case replace(KFCrossPlatformImage?)
     }
     }