SDWebImageSwiftUI
SDWebImageSwiftUI copied to clipboard
[URGENT] onProgress Callback not called / Indicator not showing
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
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.
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 ?
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
The URL is listening to changes, please friend make also the onProgressCallback to trigger when changing the url. @dreampiggy