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

# init(ids:icon:placeholderIcon:)

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using their promotional images and a custom placeholder icon.

```
nonisolated init(ids productIDs: some Collection<String>, @ViewBuilder icon: @escaping (Product, ProductIconPhase) -> Icon, @ViewBuilder placeholderIcon: () -> PlaceholderIcon)
```

## Parameters

`productIDs`

The product identifiers to load from the App Store.

`icon`

A closure that receives a [`Product`](/documentation/StoreKit/Product) and a [`ProductIconPhase`](/documentation/StoreKit/ProductIconPhase) as input. The [`ProductIconPhase`](/documentation/StoreKit/ProductIconPhase) indicates the state of the loading operation of the product’s promotional image. The closure returns the view to display for the given product and phase value.

`placeholderIcon`

A closure that returns the view that the store view uses while the products are loading. The store view uses the same placeholder image for all the products.

## Discussion

The store view shows the custom `placeholderIcon` until all products finish loading. After the products finish loading, the view asynchronously loads and displays each product’s promotional image.

Use the [`ProductIconPhase`](/documentation/StoreKit/ProductIconPhase) to monitor the current loading state of a product’s promotional image, and provide a view for each phase. Consider returning the view provided in the `placeholderIcon` closure for during the [`ProductIconPhase.loading`](/documentation/StoreKit/ProductIconPhase/loading) phase. For more information, see [`ProductIconPhase`](/documentation/StoreKit/ProductIconPhase).

If a product is unavailable, the store view uses the view that the `placeholderIcon` closure provides as a fallback.

---

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)