Hi,
I'm installing the Stripe from Cocoapods, and somehow i cannot add the STPPaymentCardTextField into the storyboard, but the only thing that shown is STPFormTextField.
What i did wrong? and how to use STPFormTextField, since my original intention is to build custom form but with card formatter and i think STPFormTextField can fulfil my need
best regards,
Suprie
Hey there,
This is kind of counterintuitive, but STPPaymentCardTextField is not actually a subclass of UITextField. As such, when you're dragging from the object pane in a storyboard, don't drag a "Text Field" - just drag a "View". Then Xcode should be able to autocomplete things properly when you're changing its class.
As far as STPFormTextField goes, this is a private class that's used internally by STPPaymentCardTextField and isn't ready to be exposed as a public header. That being said, it's open-source, so you're welcome to copy whatever parts of it you like. We did expose STPCardValidator publicly for people looking to build their own forms, so I suggest you take a look at that first.
Most helpful comment
Hey there,
This is kind of counterintuitive, but
STPPaymentCardTextFieldis not actually a subclass ofUITextField. As such, when you're dragging from the object pane in a storyboard, don't drag a "Text Field" - just drag a "View". Then Xcode should be able to autocomplete things properly when you're changing its class.As far as
STPFormTextFieldgoes, this is a private class that's used internally bySTPPaymentCardTextFieldand isn't ready to be exposed as a public header. That being said, it's open-source, so you're welcome to copy whatever parts of it you like. We did exposeSTPCardValidatorpublicly for people looking to build their own forms, so I suggest you take a look at that first.