Skip to content

Instantly share code, notes, and snippets.

@EllinaKuznetcova
Created December 9, 2016 15:38
Show Gist options
  • Save EllinaKuznetcova/bb45bc6de6b97bed5045ab19c15424f8 to your computer and use it in GitHub Desktop.
Save EllinaKuznetcova/bb45bc6de6b97bed5045ab19c15424f8 to your computer and use it in GitHub Desktop.
func purchaseProduct(productType: ProductType) {
guard let product = self.products.filter({$0.productIdentifier == productType.rawValue}).first else {
self.delegate?.inAppLoadingFailed(error: InAppErrors.noProductsAvailable)
return
}
let payment = SKMutablePayment(product: product)
SKPaymentQueue.default().add(payment)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment