import UIKit class ViewController: UIViewController { private let storeManager = StoreKitManager() override func viewDidLoad() { super.viewDidLoad() validate() } @IBAction private func yearlySubscibe() { storeManager.purchase(.yearlysubscription) { details, error in print("💵 Purchase Success ➭ \(String(describing: details))") } } @IBAction private func weeklySubscibe() { storeManager.purchase(.weeklysubscription) { details, error in print("💵 Purchase Success ➭ \(String(describing: details))") } } @IBAction private func restore() { storeManager.restorePurchases { results in print("💵 Restore Purchases ➭ \(results)") } } private func validate() { storeManager.getInfo(.weeklysubscription) { result in print("💵 Retrieve Results Weekly ➭ \(String(describing: result?.retrievedProducts.first?.localizedTitle))") } storeManager.getInfo(.yearlysubscription) { result in print("💵 Retrieve Results yearly ➭ \(String(describing: result?.retrievedProducts.first?.localizedTitle))") } storeManager.verifyPurchase(.weeklysubscription) { result, error in guard let error = error else { return } print("❌ Weekly Error: \(error.localizedDescription)") self.storeManager.verifyPurchase(.yearlysubscription) { result, error in guard let error = error else { return } print("❌ Yearly Error: \(error.localizedDescription)") } } } }