SDWebImageSwiftUI icon indicating copy to clipboard operation
SDWebImageSwiftUI copied to clipboard

[URGENT] onProgress Callback not called / Indicator not showing

Open Dave181295 opened this issue 1 year ago • 4 comments

WebImage(url: relation.imageUrl ?? URL(string: ""))
       .resizable()
       .placeholder(Image(systemName: "person.circle.fill")) 
       .indicator(.activity(style: .large))
       .transition(.fade(duration: 0.5))
       .scaledToFit()
       .frame(maxWidth: UIDevice.isIPad  ? 72 : 48, maxHeight: UIDevice.isIPad  ? 72 : 48)
       .clipShape(Circle())

The view is triggered again with the updated image when the URL is not nil, but can't figure why the loading indicator is not showing, even with a custom one.

iOS 16+ iPhone 14 Pro

Dave181295 avatar Apr 01 '23 17:04 Dave181295

Update

The onProgress callback is not called. I get directly Failure then Success, I tried to pass a Binding wrapped value, but still same problem.

Dave181295 avatar Apr 14 '23 11:04 Dave181295

Seems by design?...

If the network directly failed, current UIKit-based SDWebImage's manager or sd_setImage(on UIImageView) always ignore any progress callback.

The progress block, actually, only useful when image is from network. (if it from disk cache there are no any callback in history)

Why is this import to you ?

dreampiggy avatar Apr 23 '23 15:04 dreampiggy

Image is from network. it's first nil, and then the url is changing to retrieve an image. in this time I need a callback progress so the placeholder shows a loader... and finally the wanted image from the URL. in other words its needed to listen to the url changes @dreampiggy

Dave181295 avatar May 02 '23 06:05 Dave181295

The URL is listening to changes, please friend make also the onProgressCallback to trigger when changing the url. @dreampiggy

Dave181295 avatar May 02 '23 06:05 Dave181295