Custom Phases Async URL Image

Loads and displays a modifiable image from the specified URL load request in phases.

Custom Phases Async URL Image - iOS Liquid Glass Light Mode Preview

Platform Compatibility

iOS 27.0+ iPadOS 27.0+ macOS 27.0+ watchOS 27.0+ tvOS 27.0+ visionOS 27.0+

Tags

SwiftUI Code

Docs
VStack {
    AsyncImage(url: URL(string: "http://slowww.rf.gd")!) { phase in
        if let image = phase.image {
            image
        } else if phase.error != nil {
            Color.red
        } else {
            ProgressView()
        }
    }
    AsyncImage(url: URL(string: "https://exploreswiftui.com")!) { phase in
        if let image = phase.image {
            image
        } else if phase.error != nil {
            Color.red
        } else {
            ProgressView()
        }
    }
    .frame(height: 100)
    AsyncImage(url: URL(string: "https://exploreswiftui.com/images/cats.jpg")!) { phase in
        if let image = phase.image {
            image
                .resizable()
                .scaledToFit()
        } else if phase.error != nil {
            Color.red
        } else {
            ProgressView()
        }
    }
    .frame(height: 100)
}

Found an issue or have a suggestion?

Created: June 8, 2026Updated: June 9, 2026
Connect Wizard

Connect Wizard

Unlock hidden App Store Connect analytics

Pre-order