We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6c27d02 + 46407f9 commit 0b0c57fCopy full SHA for 0b0c57f
SDWebImageSwiftUI/Classes/ImageManager.swift
@@ -85,6 +85,7 @@ public final class ImageManager : ObservableObject {
85
self.indicatorStatus.isLoading = true
86
self.indicatorStatus.progress = 0
87
currentOperation = manager.loadImage(with: url, options: options, context: context, progress: { [weak self] (receivedSize, expectedSize, _) in
88
+ // This block may be called in non-main thread
89
guard let self = self else {
90
return
91
}
@@ -95,7 +96,11 @@ public final class ImageManager : ObservableObject {
95
96
progress = 0
97
98
self.indicatorStatus.progress = progress
- self.progressBlock?(receivedSize, expectedSize)
99
+ if let progressBlock = self.progressBlock {
100
+ DispatchQueue.main.async {
101
+ progressBlock(receivedSize, expectedSize)
102
+ }
103
104
}) { [weak self] (image, data, error, cacheType, finished, _) in
105
106
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments