StoreView
struct · iOS 17.0+ · SDK 27.1
@MainActor @preconcurrency struct StoreView<Icon, PlaceholderIcon> where Icon : View, PlaceholderIcon : ViewA view that merchandises a collection of in-app purchase products. You create a store view by providing a collection of product identifiers to load from the App Store, or a collection of ``StoreKit/Product`` values you've already loaded. If you provide product identifiers, the store will automatically load the product information from the App Store, and update the view when the products are available. You can also provide a view to use as an icon for each individual product. If you provide product identifiers, you can optionally provide a different placeholder for your icon than the automatic placeholder icon. If you set up promoted images for your products in App Store Connect, you can choose to use those images as the icons for your products. ### Layout The store arranges products as rows. If there is enough horizontal space available, the store will add columns. On tvOS, products are arranged in columns and rows are added as space permits. The store grows to fit its container, and scrolls when there is not enough space in the container to display all products. Use the ``fixedSize(horizontal:vertical:)`` modifier to change this behavior. To achieve a custom layout, you can compose ``ProductView``s with other container views instead of using the store view. ### Configuring the store The store view can display a button to sync in-app purchase entitlements with the App Store. If you want to display this button, modify the store view or an ancestor using the ``storeButton(_:for:)-2k9lq`` modifier, passing `.visible` and ``StoreButtonKind/restorePurchases`` as parameters. You can customize the appearance of the products using a product view style, like ``ProductViewStyle/compact``, and apply the style with the ``productViewStyle(_:)-58obm`` modifier.
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
8 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
StoreView.init(ids:icon:placeholderIcon:)
callback cannot propagate synchronous failure
StoreView.init(ids:prefersPromotionalIcon:icon:placeholderIcon:)
callback cannot propagate synchronous failure
StoreView.init(ids:prefersPromotionalIcon:icon:)
callback cannot propagate synchronous failure
StoreView.init(products:icon:)
callback cannot propagate synchronous failure
StoreView.init(products:prefersPromotionalIcon:icon:)
callback cannot propagate synchronous failure
StoreView.init(ids:prefersPromotionalIcon:)
This parameter hides a concrete Swift type.
StoreView.init(products:prefersPromotionalIcon:)
This parameter hides a concrete Swift type.
StoreView.body
This protocol needs associated types that cannot yet cross the bridge.