One Logo Pool Ball
_StoreKit_SwiftUI · IOS API REFERENCE

SubscriptionStoreControlStyleConfiguration

struct · iOS 17.0+ · SDK 27.1

struct SubscriptionStoreControlStyleConfiguration

The properties of a subscription store control. You don't create a configuration value directly. Instead, declare a type conforming to ``SubscriptionStoreControlStyle`` and use the configuration provided to the required ``makeBody(configuration:)`` method.

Members (6)

get · iOS 17.0+

allOptions

TypeScript
get allOptions(): Array<_StoreKit_Product>
Swift declaration
var allOptions: [Product] { get }

All subscription options available to the store, including options which should not be merchandised with this control. In certain cases, a subscription store control may be configured to only display a subset of the available options within the subscription group. For example, when declaring the content of a subscription store using a store content builder, the store may create multiple instances of your control using different configuration values. You should use this property if your control style displays comparisons to other available subscription options. For example, if you use a ``SubscriptionPeriodGroupSet``, you may want to compare the value of a yearly renewing subsription to a monthly subscription. Since each instance of your control style only displays subscriptions with a common renewal period, you won't be able to compute this comparison using only the `options` property. This value is always a superset of the `options` property. In many cases both properties will contain the same elements. - Important: In general, do **not** use this property to determine which subscription options to make available with your control. Instead, only display subscription options contained in either the `options` or `sections` property.

get · iOS 18.0+

groupDisplayName

TypeScript
get groupDisplayName(): string
Swift declaration
var groupDisplayName: String { get }

The localized display name for the subscription group the subscription store view is merchandising.

get · iOS 18.0+

autoRenewPreference

TypeScript
get autoRenewPreference(): (_StoreKit_Product) | null
Swift declaration
var autoRenewPreference: Product? { get }

The customer's current renewal preference for the subscription. If the property is `nil`, the customer isn't actively subscribed to this subscription. Use this property to disable or add other visual treatment to the current renewal preference. You can also use this property to apply visual treatment to options based on their relative level of service to the current renewal preference. Only display a means to subscribe to this subscription option if it is included in the ``options`` array. For convenience, the product metadata for the renewal preference is always provided, even if the subscription store view is configured to exclude this option. Consider blocking any subscribe interactions for the customer's current renewal preference. If a customer tries to subscribe to this product, a system dialog will always be presented to explain the customer is already subscribed. - Important: Don't use this property to determine whether to grant access to the service this subscription is for. Always check the full transaction information before granting access to paid service. This property is useful for quickly understanding if a purchase will succeed.

get · iOS 18.0+

descriptionVisibility

TypeScript
get descriptionVisibility(): _SwiftUICore_Visibility
Swift declaration
var descriptionVisibility: Visibility { get }

The visibility of the product descriptions. This property is available if you choose to support configuring the description visibility in your custom control style. It reflects the value set with the ``SwiftUI/View/productDescription(_:)`` view modifier on an ancestor view. For standard styles which typically display the `description` property of the `Product`, this label is not displayed when the visibility is `hidden`.

get · iOS 18.0+

options

TypeScript
get options(): Array<SubscriptionStoreControlStyleConfiguration_Option>
Swift declaration
var options: [SubscriptionStoreControlStyleConfiguration.Option] { get }

The subscription options to merchandise. Your subscription store control style should provide a means to subscribe to each option in the array. Use the properties of each option to declare your control style, and use the ``Option/subscribe()`` method in response to a subscribe interaction. Prefer to use the initializer of the subscription store view to hide and sort subscription options. This array maintains the sort order and only includes the options provided to the subscription store view's initializer. There may be subscription options in the same subscription group which are not contained in this property. This indicates the excluded options should be hidden from the subscription controls. You can use the ``allOptions`` property to access these options to compare them to the options included in this control. Subscription store views can be configured to partition the options a control offers into sections. You may choose to use this section information to apply visual treatment to sections and compose your control style of decorative header and footer views. If you choose to do this, use the ``sections`` property instead of this property. If the customer is currently subscribed and the subscription store is configured to show the current subscription, this property will be contain ``autoRenewPreference`` as an element. - Important: In general, your control style does not need to use both this property and ``sections``. Only use this property if your control style does not support sections, otherwise use the ``sections`` property to access section information.

get · iOS 18.0+

sections

TypeScript
get sections(): Array<SubscriptionStoreControlStyleConfiguration_Section>
Swift declaration
var sections: [SubscriptionStoreControlStyleConfiguration.Section] { get }

The sections of subscription options to merchandise. Use this property if your control style supports applying visual treatment to sections and displaying optional accessory views. If you choose to not support sections, you can use the ``options`` property instead. This property always contains the same contents as ``options``, but preserves the section structure and allows you to compose your control of decorative header or footer views. In many cases this property will only contain a single element. In these cases, the single section's ``Section/options`` property is equivalent with the ``options`` property on the configuration value. - SeeAlso: Read the documentation for ``options`` for more general guidance for how to determine which options to make available in your control. - Important: In general, your control style does not need to use both this property and ``options``. Only use this property if your control style supports sections, otherwise use the ``options`` property to disregard section information.

Skipped declarations

No declarations were skipped in this snapshot.

All _StoreKit_SwiftUI types →