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

Move the inline init to an explicit initializer

onevcat 5 лет назад
Родитель
Сommit
7ff9bcc54f
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      Sources/Image/ImageProgressive.swift

+ 5 - 1
Sources/Image/ImageProgressive.swift

@@ -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