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
1515public final class ImageManager : ObservableObject {
1616 /// loaded image, note when progressive loading, this will published multiple times with different partial image
1717 @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 ?
1820 /// loading error, you can grab the error code and reason listed in `SDWebImageErrorDomain`, to provide a user interface about the error reason
1921 @Published public var error : Error ?
2022 /// whether network is loading or cache is querying, should only be used for indicator binding
@@ -86,6 +88,7 @@ public final class ImageManager : ObservableObject {
8688 self . error = error
8789 self . isIncremental = !finished
8890 if finished {
91+ self . imageData = data
8992 self . isLoading = false
9093 self . progress = 1
9194 if let image = image {
You can’t perform that action at this time.
0 commit comments