init(products:icon:)
Creates a view to merchandise a collection of products with promotional images.
Declaration
nonisolated init(products: some Collection<Product>, @ViewBuilder icon: @escaping (Product, ProductIconPhase) -> Icon) where PlaceholderIcon == EmptyViewParameters
- products:
The products to merchandise.
- icon:
A closure that receives a Product and a Producticonphase as input. The 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.
Discussion
The store view asynchronously loads and displays each product’s promotional image. Use the ProductIconPhase to monitor the current loading phase of the product’s promotional image, and provide an image for each phase. For more information about the loading phases, see ProductIconPhase.