---
title: AsyncImagePhase
framework: swiftui
role: symbol
role_heading: Enumeration
path: swiftui/asyncimagephase
---

# AsyncImagePhase

The current phase of the asynchronous image loading operation.

## Declaration

```swift
enum AsyncImagePhase
```

## Overview

Overview When you create an AsyncImage instance with the init(url:scale:transaction:content:) initializer, you define the appearance of the view using a content closure. SwiftUI calls the closure with a phase value at different points during the load operation to indicate the current state. Use the phase to decide what to draw. For example, you can draw the loaded image if it exists, a view that indicates an error, or a placeholder: AsyncImage(url: URL(string: "https://example.com/icon.png")) { phase in     if let image = phase.image {         image // Displays the loaded image.     } else if phase.error != nil {         Color.red // Indicates an error.     } else {         Color.blue // Acts as a placeholder.     } }

## Topics

### Getting load phases

- [AsyncImagePhase.empty](swiftui/asyncimagephase/empty.md)
- [AsyncImagePhase.success(_:)](swiftui/asyncimagephase/success(_:).md)
- [AsyncImagePhase.failure(_:)](swiftui/asyncimagephase/failure(_:).md)

### Getting the image

- [image](swiftui/asyncimagephase/image.md)

### Getting the error

- [error](swiftui/asyncimagephase/error.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Loading images asynchronously

- [AsyncImage](swiftui/asyncimage.md)
