SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.14k stars 219 forks source link

Unable to load error placeholder #182

Open RelatApp opened 3 years ago

RelatApp commented 3 years ago

Experienced in android, noob in swiftui, i can t find the way to display a specific placeholder on error . Some indications are given : .delayPlaceholder but this is quite vague for someone with little experience . No specific help from the demo part . Sorry if this appears obvious for most of you

dreampiggy commented 3 years ago

delayPlaceholder is the feature for this use case.

  1. indicator: Showing only when loading
  2. delayPlaceholder + placeholder: Showing only when failed

You can use both of them together. Or you can use onSuccess, onFailed to achieve the same result.

However, current SDWebImageSwiftUI on iOS 14 has bugs with delayPlaceholder. Try iOS 13 and see the result.

Fixing solution is #180, but need some testing.

RelatApp commented 3 years ago

Thank you for your answser. I'm on Ios14.Coming from android background the logic is clear for me but the details aren t . I don t know if on failure i can force load the same SDimage or if , for example ,i must make this image invisible (placeholder is still visible in case of error) and make an Image appear . Anyway, thank you for your time