How can I achieve such a scenario.
- Using the AsyncImage I load the url.
- Progress view turns around as placeholder
- After 2 seconds we don't get an error
- Our ProgressView changes to an image
This is a code:
AsyncImage(url: exampleURL) { phase in
if let image = phase.image {
image
.imageModifier()
} else if phase.error != nil {
Image("example_image")
.imageModifier()
} else {
ProgressView()
.font(.largeTitle)
}
}
There is any short and clean solution of I need to using custom implementation async image and using for example taskgroups? Thanks for any ideas.