|
|
@@ -80,6 +80,9 @@ public enum KingfisherOptionsInfoItem {
|
|
|
/// If set, `Kingfisher` will only cache the value in memory but not in disk.
|
|
|
case cacheMemoryOnly
|
|
|
|
|
|
+ /// If set, `Kingfisher` will wait for caching operation to be completed before calling the completion block.
|
|
|
+ case waitForCache
|
|
|
+
|
|
|
/// If set, `Kingfisher` will only try to retrieve the image from cache not from network.
|
|
|
case onlyFromCache
|
|
|
|
|
|
@@ -165,6 +168,7 @@ func <== (lhs: KingfisherOptionsInfoItem, rhs: KingfisherOptionsInfoItem) -> Boo
|
|
|
case (.fromMemoryCacheOrRefresh, .fromMemoryCacheOrRefresh): return true
|
|
|
case (.forceTransition, .forceTransition): return true
|
|
|
case (.cacheMemoryOnly, .cacheMemoryOnly): return true
|
|
|
+ case (.waitForCache, .waitForCache): return true
|
|
|
case (.onlyFromCache, .onlyFromCache): return true
|
|
|
case (.backgroundDecode, .backgroundDecode): return true
|
|
|
case (.callbackDispatchQueue(_), .callbackDispatchQueue(_)): return true
|
|
|
@@ -264,6 +268,11 @@ public extension Collection where Iterator.Element == KingfisherOptionsInfoItem
|
|
|
return contains{ $0 <== .cacheMemoryOnly }
|
|
|
}
|
|
|
|
|
|
+ /// Whether the caching operation will be waited or not.
|
|
|
+ public var waitForCache: Bool {
|
|
|
+ return contains{ $0 <== .waitForCache }
|
|
|
+ }
|
|
|
+
|
|
|
/// Whether only load the images from cache or not.
|
|
|
public var onlyFromCache: Bool {
|
|
|
return contains{ $0 <== .onlyFromCache }
|