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

Add a default case and rename keep case

onevcat 3 лет назад
Родитель
Сommit
6895d6f19e
2 измененных файлов с 6 добавлено и 3 удалено
  1. 2 1
      Sources/General/KingfisherManager.swift
  2. 4 2
      Sources/Image/ImageProgressive.swift

+ 2 - 1
Sources/General/KingfisherManager.swift

@@ -234,7 +234,8 @@ public class KingfisherManager {
                 return
             }
             switch strategy {
-            case .keep: setter(image)
+            case .default: setter(image)
+            case .keepCurrent: break
             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.
     ///
-    /// - 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
     ///            Kingfisher, the replacing image will be used to update the view.
     public enum UpdatingStrategy {
-        case keep
+        case `default`
+        case keepCurrent
         case replace(KFCrossPlatformImage?)
     }