Use of unresolved identifier when using StoreKit constants with iOS 9.3/Xcode 7.3

Viewed 3119

I get the error "Use of unresolved identifier" when trying to use one of these StoreKit constants:

SKErrorClientInvalid
SKErrorPaymentCancelled
SKErrorPaymentInvalid
SKErrorPaymentNotAllowed
SKErrorStoreProductNotAvailable
SKErrorUnknown

Your code may look like this:

if transaction.error!.code == SKErrorPaymentCancelled {
    print("Transaction Cancelled: \(transaction.error!.localizedDescription)")
}

What changed? Is there a new module I need to import?

3 Answers
Related