Stripe-ios: STPPaymentCardTextField not shown in Storyboard

Created on 20 Sep 2015  路  1Comment  路  Source: stripe/stripe-ios

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

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mansoorshahsaid picture mansoorshahsaid  路  4Comments

chrismanderson picture chrismanderson  路  4Comments

imhugofonseca picture imhugofonseca  路  7Comments

billinghamj picture billinghamj  路  6Comments

paynd picture paynd  路  3Comments