|
|
@@ -262,11 +262,15 @@ private final class ImageProgressiveDecoder {
|
|
|
private final class ImageProgressiveSerialQueue {
|
|
|
typealias ClosureCallback = ((@escaping () -> Void)) -> Void
|
|
|
|
|
|
- private let queue: DispatchQueue = .init(label: "com.onevcat.Kingfisher.ImageProgressive.SerialQueue")
|
|
|
+ private let queue: DispatchQueue
|
|
|
private var items: [DispatchWorkItem] = []
|
|
|
private var notify: (() -> Void)?
|
|
|
private var lastTime: TimeInterval?
|
|
|
var count: Int { return items.count }
|
|
|
+
|
|
|
+ init() {
|
|
|
+ self.queue = DispatchQueue(label: "com.onevcat.Kingfisher.ImageProgressive.SerialQueue")
|
|
|
+ }
|
|
|
|
|
|
func add(minimum interval: TimeInterval, closure: @escaping ClosureCallback) {
|
|
|
let completion = { [weak self] in
|