File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
SDWebImageSwiftUI/Classes Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import SDWebImage
15
15
public final class ImageManager : ObservableObject {
16
16
/// loaded image, note when progressive loading, this will published multiple times with different partial image
17
17
@Published public var image : PlatformImage ?
18
+ /// loaded image data, may be nil if hit from memory cache. This will only published once even on incremental image loading
19
+ @Published public var imageData : Data ?
18
20
/// loading error, you can grab the error code and reason listed in `SDWebImageErrorDomain`, to provide a user interface about the error reason
19
21
@Published public var error : Error ?
20
22
/// whether network is loading or cache is querying, should only be used for indicator binding
@@ -87,6 +89,7 @@ public final class ImageManager : ObservableObject {
87
89
self . error = error
88
90
self . isIncremental = !finished
89
91
if finished {
92
+ self . imageData = data
90
93
self . isLoading = false
91
94
self . progress = 1
92
95
if let image = image {
You can’t perform that action at this time.
0 commit comments