<!--
{
  "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/StoreView/init(products:prefersPromotionalIcon:icon:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:17_StoreKit_SwiftUI0A4ViewV8products22prefersPromotionalIcon4iconACyx0cD005EmptyE0VGqd___Sbx0aB07ProductVctcAIRs_SlRd__AM7ElementRtd__lufc"
  },
  "title" : "init(products:prefersPromotionalIcon:icon:)"
}
-->

# init(products:prefersPromotionalIcon:icon:)

Creates a view to merchandise a collection of products using a custom icon.

```
nonisolated init(products: some Collection<Product>, prefersPromotionalIcon: Bool = false, @ViewBuilder icon: @escaping (Product) -> Icon) where PlaceholderIcon == EmptyView
```

## Parameters

`products`

The products to merchandise.

`prefersPromotionalIcon`

A Boolean value that indicates whether to use promotional images from the App Store, if they’re available. If this parameter is `false`, the system ignores promotional images.

`icon`

A closure that returns the image the view displays when the products finish loading from the App Store.

## Discussion

If you set `prefersPromotionalIcon` to `true`, the view uses promotional images for products that have a promotional image available.

The following code example shows how to create a store view using a custom icon:

```swift
StoreView(products: [
          product1,
          product2,
          // Add products as needed.
 ]) { product in
    Image(systemName: "star.fill")
        .foregroundStyle(.yellow)
    }  
```

---

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)