Custom Placeholder Async URL Image
Loads and displays a modifiable image from the specified URL load request using a custom placeholder until the image loads.
Platform Compatibility
Tags
SwiftUI Code
VStack {
AsyncImage(request: URLRequest(url: slowURL)) { image in
image.resizable(resizingMode: .tile)
.resizable()
.scaledToFit()
} placeholder: {
ProgressView()
}
AsyncImage(request: URLRequest(url: imageURL)) { image in
image.resizable(resizingMode: .tile)
.resizable()
.scaledToFit()
} placeholder: {
ProgressView()
}
.frame(height: 100)
}