One Logo Pool Ball
_StoreKit_SwiftUI · IOS API REFERENCE

ProductViewStyle

protocol · iOS 17.0+ · SDK 27.1

@MainActor @preconcurrency protocol ProductViewStyle

A type that specifies the appearance and interaction of product views within the view hierarchy. To configure the product view style for a view hierarchy, use the ``SwiftUI/View/productViewStyle(_:)-4c803`` modifier. To create a custom style, declare a type that conforms to ``ProductViewStyle``. Implement the ``makeBody(configuration:)`` method to return a view that composes the elements of the configuration the system provides to your method. ``` struct CustomProductViewStyle: ProductViewStyle { func makeBody(configuration: Configuration) -> some View { switch configuration.state { ... case .success(let product): VStack(alignment: .center) { configuration.icon Text(product.displayName) Button(product.displayPrice) { ... } } } } } ... ProductView(id: "com.example.product") .productViewStyle(CustomProductViewStyle()) ```

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

ProductViewStyle.automatic

Static protocol requirements cannot be called through an instance.

ProductViewStyle.regular

Static protocol requirements cannot be called through an instance.

ProductViewStyle.large

Static protocol requirements cannot be called through an instance.

ProductViewStyle.compact

Static protocol requirements cannot be called through an instance.

All _StoreKit_SwiftUI types →