0.13.3
We have a wrapper around SwiftyStoreKit, using classes like RetrieveResults, Purchase, PurchaseDetails, RestoreResults. We have a lot of tests for the wrapper to ensure functionality. So far we could instantiate these classes for testing by creating an initialiser in an extension like so:
extension Purchase {
init(productId: String, transaction: PaymentTransaction) {
self.productId = productId
self.transaction = transaction
self.quantity = 1
self.needsFinishTransaction = true
self.originalTransaction = nil
}
}
With this new compiler directive, this is not possible any more. Instead an error is thrown:
Warning: initializer for struct 'Purchase' must use "self.init(...)" or "self = ..." because it is not in module 'SwiftyStoreKit'
Would it be possible to add public initialisers to these classes? At least for testing?
Being able to create instances of the above classes for testing
Compiler warning that will become an error in Swift 5
Does / would PR #529 fix this issue for you?
Implemented 馃殌! Find the latest changes on the develop branch. Expect to find this in a new release on master within a few days.
@Sam-Spencer Hey, thank you for taking care of this. The change is exactly what we needed and works fine 馃憤