Interactive previews iPhone

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 on iPhone - Portrait - 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

More AsyncImage Components

View all
Custom Session Async URL Image - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Custom Session Async URL Image

A modifier that adds a URL session for asynchronous images contained in the view to use when fetching image data.

Custom Placeholder Async URL Image - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

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.

Async URL Image - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Async URL Image

Loads and displays an image from the specified URL load request.

Explore Other Components

Browse all
MenuPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

MenuPickerStyle

A picker style that presents the options as a menu when the user presses a button, or as a submenu when nested within a larger menu.

Background Extension Effect - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Background Extension Effect

Adds the background extension effect to the view. The view will be duplicated into mirrored copies which will be placed around the view on any edge with available safe area. Additionally, a blur effect will be applied on top to blur out the copies

Custom Icon Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Custom Icon Store View

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using a custom image.

Custom Photo Picker Buttons - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Custom Photo Picker Buttons

Sets the primary and secondary button types of the Photos picker.

LargeProductViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

LargeProductViewStyle

A style for a product view that’s suitable for layouts where the in-app purchase content is prominent.

Sheet Drag Indicator Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Sheet Drag Indicator Visibility

Sets the visibility of the drag indicator on top of a sheet.

Store Cancellation Button - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Store Cancellation Button

A type of button that people use to dismiss the current store presentation. It is displayed by default and only works in a sheet.

Placeholder Icon Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Placeholder Icon Store View

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using an image and a custom placeholder icon.