Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[URGENT] onProgress Callback not called / Indicator not showing #258

Open
Dave181295 opened this issue Apr 1, 2023 · 4 comments
Open

[URGENT] onProgress Callback not called / Indicator not showing #258

Dave181295 opened this issue Apr 1, 2023 · 4 comments

Comments

@Dave181295
Copy link

Dave181295 commented Apr 1, 2023

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
Copy link
Author

Dave181295 commented Apr 14, 2023

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 Dave181295 changed the title iOS 16+ Indicator not showing iOS 16+ onProgress Callback not called / Indicator not showing Apr 14, 2023
@Dave181295 Dave181295 changed the title iOS 16+ onProgress Callback not called / Indicator not showing onProgress Callback not called / Indicator not showing Apr 14, 2023
@Dave181295 Dave181295 changed the title onProgress Callback not called / Indicator not showing [URGENT] onProgress Callback not called / Indicator not showing Apr 14, 2023
@dreampiggy
Copy link
Collaborator

dreampiggy commented Apr 23, 2023

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 ?

@Dave181295
Copy link
Author

Dave181295 commented May 2, 2023

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants