I have the same issue with iOS 15.2. Actually the reason is clear and iOS behavior is acceptable. I am trying to fetch 20 images at the same time... On the other hand I have to overcome this issue... So my quick workaround is like the following;
I hope it works for your scenario. I also try to improve it(, if I have time).
AsyncImage(url: url) { phase in
switch phase {
case .success(let image):
image
.resizable()
.scaledToFill()
case .failure:
//Call the AsynchImage 2nd time - when there is a failure. (I think you can also check NSURLErrorCancelled = -999)
AsyncImage(url: url) { phase in
if let image = phase.image {
image
.resizable()
.scaledToFill()
} else{
Image(systemName: "xmark.octagon")
}
}
//...
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: