I need to grab another image in case the initial one fails and Im having a hard time figuring how to do this with SDWebImageSwiftUI.
Any clue as to how to do this?
I need to grab another image in case the initial one fails and Im having a hard time figuring how to do this with SDWebImageSwiftUI.
Any clue as to how to do this?
2
Answers
The above code worked for me,
Hope it will work for you 🙂
You could use the
onFailure
property onWebImage
. Something like this could work:Just change the initial url to
"https://via.placeholder.com"
and that will cause a failure to load the image, which will in turn update theurl
and cause the image to be reloaded with the newurl
.