SDWebImageSwiftUI
SDWebImageSwiftUI copied to clipboard
AnimatedImage gets stuck on failure
Just by adding an AnimatedImage with a failing url causes the AnimatedImage to fall in an endless loop where it tries to load itself and just fails to do so each time, getting updateUIView triggered every time it fails.
The effect is even worse if the url is invalid as it gets stuck on the main thread.
Just a simple empty project with this ContentView is enough to display the problem.
struct ContentView: View {
var body: some View {
AnimatedImage(url: URL(string: "something"))
.onFailure(perform: { err in
print("Error", err)
})
}
}