SDWebImageSwiftUI icon indicating copy to clipboard operation
SDWebImageSwiftUI copied to clipboard

AnimatedImage gets stuck on failure

Open Enricoza opened this issue 4 years ago • 0 comments

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)
            })
    }
}

Enricoza avatar Dec 03 '21 14:12 Enricoza