View Source AsyncImage

<AsyncImage>

Displays an image asynchronously loaded from a URL.

Overview

<AsyncImage url="http://localhost:4000/example.jpg" />

While the image is loading, a circular progress view is shown. If the image fails to load, text containing the error message is shown. Attributes:

SwiftUI Documentation

See SwiftUI.AsyncImage for more details on this View.

References

The display scale of the image (defaults to 1).

Discussion

This corresponds to the @2x, @3x suffixes you would use for images shipped with the app. A scale of 1 indicates that 1 pixel in the image corresponds to 1 point, a scale of 2 indicates that there are 2 image pixels per point, etc.

The transaction to use when transitioning between async image phases.

Discussion

Typically, you would provide an animation to the transaction

%{ animation: :default }

The URL from which to load the image (relative to the current Live View’s URL).

Discussion

If no URL is provided, the view will remain in the loading state.