stripe-kit
stripe-kit copied to clipboard
Initializers for models?
It would be helpful if you could create a Stripe model (StripeCustomer
for example) with an initializer. Although all of the models right now are structs
, one easy way in Xcode to generate initializers is to make them classes temporarily and generate member wise initializer.

Will result in the following initializer. Note we don't automatically get default nil values in the initializers.

This is easy but takes time is all.
@Andrewangeta Does it need to make for all classes inherited from StipeModel protocol?
@Andrewangeta Does it need to make for all classes inherited from StipeModel protocol?
Yea we still need to conform to that protocol because of the generic sending of the stripe request. My thinking is that we temporarily make them classes to generate the initializer and then make them structs again afterwards.
As an update Xcode 11.4 now can generate memberwise initializers from structs and also populates default values parameters.
Being addressed by #152