---
title: "init(_:icon:)"
framework: storekit
role: symbol
role_heading: Initializer
path: "storekit/productview/init(_:icon:)"
---

# init(_:icon:)

Creates a view to display a product that the system already loaded from the App Store, and merchandise it using its promotional image.

## Declaration

```swift
nonisolated init(_ product: Product, @ViewBuilder icon: @escaping (ProductIconPhase) -> Icon) where PlaceholderIcon == EmptyView
```

## Parameters

- `product`: The product to merchandise.
- `icon`: A closure that receives a doc://com.apple.storekit/documentation/StoreKit/ProductIconPhase as an input, which indicates the state of the loading operation of the product’s promoted image, and returns the view to display for the specified phase.

## Discussion

Discussion The product view asynchronously loads and displays the product’s promotional image. The ProductIconPhase value indicates whether the promotional image is loading, unavailable, or whether it succeeded or failed to load. Use the ProductIconPhase to monitor current loading phase, and to decide the image to return in the icon closure.

## See Also

### Creating product views with preloaded products

- [init(_:prefersPromotionalIcon:icon:)](storekit/productview/init(_:preferspromotionalicon:icon:).md)
- [init(_:prefersPromotionalIcon:)](storekit/productview/init(_:preferspromotionalicon:).md)
