iPhone SwiftUI layouts

Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.

AsyncImage

Custom Phases Async URL Image

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

Explore Custom Phases Async URL Image on iPhone in portrait, with SwiftUI code and Apple API documentation.

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)
}
iOS 27.0+ iPadOS 27.0+ macOS 27.0+ watchOS 27.0+ tvOS 27.0+ visionOS 27.0+

Every available iPhone screenshot for Custom Phases Async URL Image.

1 views