How to add in-app purchases in SwiftUI

How to add in-app purchases in SwiftUI

If you import StoreKit, you can use StoreViewSubscriptionStoreView, and ProductView to present in-app purchases to your users, including handling the process of starting the purchase. This still leaves a fair amount of StoreKit work for you to do, including processing the actual purchase transactions and so on, but I wouldn’t rule out Apple requiring apps to use this standardized interface in future releases.