StoreKit views
Display a customizable In-App Purchase store using StoreKit views for SwiftUI.
Overview
The StoreKit views APIs provide UI to help you build a store for your In-App Purchases, and provide a way for customers to complete the purchase. The views support localization, so your customers see the product names, descriptions, and prices appropriate to their App Store storefront.
StoreKit manages the layouts across all platforms, so the views look great on any device. You can use SwiftUI APIs to customize how the views integrate with your app.
To use StoreKit views, configure your In-App Purchase metadata in App Store Connect, or in a StoreKit configuration file in Xcode if you’re testing your app. Next, create the views using StoreView, ProductView, or SubscriptionStoreView. Finally, customize the default views to match your app by using your own icons, backgrounds, and other styling. Use Previews in Xcode to see your progress as you iterate on your design.
For more information on configuring your In-App Purchase metadata, see Manage In-App Purchases. For more information on StoreKit configuration files in Xcode, see Setting up StoreKit Testing in Xcode.
Topics
Merchandising In-App Purchases, subscriptions, and offers
ProductViewStoreViewSubscriptionStoreViewSubscriptionOfferViewBackyard Birds: Building an app with SwiftData and widgets
Styling product views
Styling subscription store controls
subscriptionStoreControlStyle(_:)subscriptionStoreControlStyle(_:placement:)SubscriptionStoreControlStyleSubscriptionStoreControlStyleConfigurationSubscriptionStoreControlPlacement
Styling subscription offer views
AutomaticSubscriptionOfferViewStyleCompactSubscriptionOfferViewStyleSubscriptionOfferViewStyleConfigurationSubscriptionOfferViewStyle
Configuring subscription store controls
subscriptionStoreControlIcon(icon:)subscriptionStorePickerItemBackground(_:)subscriptionStorePickerItemBackground(_:in:)subscriptionStoreButtonLabel(_:)SubscriptionStoreButtonLabel
Creating custom subscription store control styles
Declaring the structure of a subscription store
SubscriptionOptionGroupSubscriptionOptionGroupSetSubscriptionPeriodGroupSetSubscriptionOptionSectionStoreContentStoreContentBuilder
Styling subscription option groups
subscriptionStoreOptionGroupStyle(_:)subscriptionStoreOptionGroupStyle(_:)SubscriptionOptionGroupStyle
Adding backgrounds to subscription stores
containerBackground(_:for:)containerBackground(for:alignment:content:)subscriptionStoreControlBackground(_:)subscriptionStoreControlBackground(_:)subscriptionStoresubscriptionStoreHeadersubscriptionStoreFullHeightSubscriptionStoreControlBackground
Configuring accessory buttons
Configuring the subscription store policies
subscriptionStorePolicyDestination(for:destination:)subscriptionStorePolicyDestination(url:for:)subscriptionStorePolicyForegroundStyle(_:)subscriptionStorePolicyForegroundStyle(_:_:)SubscriptionStorePolicyKind
Selecting subscription offers
subscriptionPromotionalOffer(offer:signature:)preferredSubscriptionOffer(_:)offerCodeRedemption(isPresented:onCompletion:)
Configuring purchase options and product descriptions
Responding to store events
Loading StoreKit data
storeProductTask(for:priority:action:)storeProductsTask(for:priority:action:)currentEntitlementTask(for:priority:action:)subscriptionStatusTask(for:priority:action:)Product.CollectionTaskStateProduct.TaskStateEntitlementTaskState