<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/ProductIconPhase",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:17_StoreKit_SwiftUI16ProductIconPhaseO"
  },
  "title" : "ProductIconPhase"
}
-->

# ProductIconPhase

The current phase of the asynchronous loading operation of a product’s promotional image.

```
enum ProductIconPhase
```

## Overview

When you create a [`ProductIconPhase`](/documentation/StoreKit/ProductIconPhase) instance with an initializer such as [`init(ids:icon:placeholderIcon:)`](/documentation/StoreKit/StoreView/init(ids:icon:placeholderIcon:)), you define the appearance of the view’s icon, or image, using a content closure. SwiftUI calls the closure at different stages of the promotional image’s load operation with a phase value that indicates the current state.

Use the phase to decide what to draw. For example, you can draw a placeholder image during the loading phase, a view that indicates an error, a default image, or the loaded promotional image if it exists:

```swift
StoreView(products: [
     product1,
     product2,
     // Additional products, as needed.
 ]) { product, phase in
     switch phase {
     case .loading: MyPlaceholder()
     case .failure(let error): MyErrorView(error)
     case .unavailable: MyDefaultIcon()
     case .success(let promotedIcon): promotedIcon
     }
 }
```

You set up promotional images for Apple In-App Purchases in App Store Connect. For more information, see [Promote Apple In-App Purchases](https://developer.apple.com/help/app-store-connect/configure-in-app-purchase-settings/promote-in-app-purchases).

## Topics

### Getting the promotional image’s load phases

[`case loading`](/documentation/StoreKit/ProductIconPhase/loading)

The promotional image is in the process of loading.

[`case success(Image)`](/documentation/StoreKit/ProductIconPhase/success(_:))

The promotional image successfully loaded.

[`case unavailable`](/documentation/StoreKit/ProductIconPhase/unavailable)

The promotional image isn’t available for download.

[`case failure(any Error)`](/documentation/StoreKit/ProductIconPhase/failure(_:))

The promotional image failed to load, with an error.

### Getting the promotional image

[`var promotionalIcon: Image?`](/documentation/StoreKit/ProductIconPhase/promotionalIcon)

The promotional image, if the loading task is successful.

### Getting the error

[`var error: (any Error)?`](/documentation/StoreKit/ProductIconPhase/error)

The error value that indicates the reason a promotional image failed to load.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)