AsyncImage(url: URL(string: breed.image!.url!)) { phase in
if let image = phase.image {
image.resizable()
.scaledToFill()
.frame(width: imageSize, height: imageSize)
.clipped()
} else if phase.error != nil {
Text(phase.error?.localizedDescription ?? "error")
.foregroundColor(Color.pink)
.frame(width: imageSize, height: imageSize)
} else {
ProgressView()
.frame(width: imageSize, height: imageSize)
}
}
网友评论