Classes

The following classes are available globally.

  • Contains form elements for entering card information.

    See more

    Declaration

    Objective-C

    @interface BTCardFormViewController : BTDropInBaseViewController

    Swift

    class BTCardFormViewController : BTDropInBaseViewController
  • The base UIViewController for the sub UIViewControllers using in Drop-In

    See more

    Declaration

    Objective-C

    @interface BTDropInBaseViewController : UIViewController

    Swift

    class BTDropInBaseViewController : UIViewController
  • The primary UIViewController for Drop-In. BTDropInController will manage the other UIViewControllers and return a BTDropInResult.

    See more

    Declaration

    Objective-C

    @interface BTDropInController
        : UIViewController <UIToolbarDelegate,
                            UIViewControllerTransitioningDelegate>

    Swift

    class BTDropInController : UIViewController, UIToolbarDelegate, UIViewControllerTransitioningDelegate
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTDropInRequest : NSObject <NSCopying>
    
    /// Optional: Specify the options for the PayPal flow. If not present, a default vault flow will be used.
    ///
    /// Note: The checkout flow is used when an amount is set on the `payPalRequest`.
    @property (nonatomic, strong, nullable) BTPayPalRequest *payPalRequest;
    
    /// Optional: Use this parameter to disable Apple Pay. Otherwise if Apple Pay is correctly configured, Apple Pay will appear as a selection in the Payment Method options.
    @property (nonatomic, assign) BOOL applePayDisabled;
    
    /// Defaults to false. Set to true to hide the PayPal option even if enabled for your account.
    @property (nonatomic, assign) BOOL paypalDisabled;
    
    /// Defaults to false. Set to true to hide the Venmo option even if enabled for your account.
    @property (nonatomic, assign) BOOL venmoDisabled;
    
    /// Defaults to false. Set to true to hide the Card option even if enabled for your account.
    @property (nonatomic, assign) BOOL cardDisabled;
    
    /// Optional: If true and an amount is set, ThreeDSecure will be used to verify new cards. ThreeDSecure must be enabled in the control panel.
    /// Defaults to false.
    @property (nonatomic, assign) BOOL threeDSecureVerification;
    
    /// Optional: Enable 3DS verification and specify options and additional information. If no amount is set, the `BTDropInRequest` `amount` will be used.
    ///
    /// Note: To encourage 3DS 2.0 flows, set `billingAddress`, `amount`, `email`, `mobilePhone` for best results.
    @property (nonatomic, strong, nullable) BTThreeDSecureRequest *threeDSecureRequest;
    
    /// Optional: Determines the visibility and input requirements of the cardholder name field.
    ///
    /// When set to BTFormFieldDisabled, the cardholder name field will not be displayed.
    /// When set to BTFormFieldOptional, the cardholder name field will be displayed but not required.
    /// When set to BTFormFieldRequired, the cardholder name field will be displayed and required.
    ///
    /// Defaults to BTFormFieldDisabled.
    @property (nonatomic, assign) BTFormFieldSetting cardholderNameSetting;
    
    /// Optional: If true the security code will be masked.
    /// Defaults to false.
    @property (nonatomic, assign) BOOL shouldMaskSecurityCode;
    
    /// Optional: If true, enables the managment UI.
    /// Defaults to false.
    @property (nonatomic, assign) BOOL vaultManager;
    
    /// Optional: Whether or not to vault the card upon tokenization, can only be applied when initializing the Braintree client with a client token that was generated with a customer ID. When set to `false` with `allowVaultCardOverride` set to `false`, then cards will not be vaulted.
    /// Defaults to true
    @property (nonatomic, assign) BOOL vaultCard;
    
    /// Optional: When true, the card form will include an option to let the customer decide not to vault the card.
    /// Defaults to false
    @property (nonatomic, assign) BOOL allowVaultCardOverride;
    
    /// Optional: Whether or not to vault the Venmo payment method upon tokenization, must be set to `false` when using a client token without a `customerId`.
    /// Defaults to true
    @property (nonatomic, assign) BOOL vaultVenmo;
    
    @end

    Swift

    class BTDropInRequest : NSObject, NSCopying
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTDropInResult : NSObject
    
    typedef void (^BTDropInResultFetchHandler)(BTDropInResult * _Nullable result, NSError * _Nullable error);
    
    /// True if the modal was dismissed without selecting a payment method
    @property (nonatomic, assign, getter=isCancelled) BOOL cancelled;
    
    /// The type of the payment option
    @property (nonatomic, assign) BTUIKPaymentOptionType paymentOptionType;
    
    /// A UIView (BTUIKPaymentOptionCardView) that represents the payment option
    @property (nonatomic, readonly) UIView *paymentIcon;
    
    /// A description of the payment option (e.g `ending in 1234`)
    @property (nonatomic, readonly) NSString *paymentDescription;
    
    /// The payment method nonce
    @property (nonatomic, strong, nullable) BTPaymentMethodNonce *paymentMethod;
    
    /// Fetch a BTDropInResult without displaying or initializing a BTDropInController. Works with client tokens that
    /// were created with a `customer_id`.
    ///
    /// @param authorization Your tokenization key or client token.
    /// @param handler The handler for callbacks.
    + (void)fetchDropInResultForAuthorization:(NSString *)authorization handler:(BTDropInResultFetchHandler)handler;
    
    @end

    Swift

    class BTDropInResult : NSObject
  • @class A UIViewController that displays vaulted payment methods for a customer and available payment options

    See more

    Declaration

    Objective-C

    @interface BTPaymentSelectionViewController
        : BTDropInBaseViewController <UICollectionViewDataSource,
                                      UICollectionViewDelegate,
                                      UICollectionViewDelegateFlowLayout,
                                      UITableViewDataSource, UITableViewDelegate>

    Swift

    class BTPaymentSelectionViewController : BTDropInBaseViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UITableViewDataSource, UITableViewDelegate
  • Contains form elements for editing vaulted payment methods.

    See more

    Declaration

    Objective-C

    @interface BTVaultManagementViewController
        : BTDropInBaseViewController <UITableViewDataSource, UITableViewDelegate>

    Swift

    class BTVaultManagementViewController : BTDropInBaseViewController, UITableViewDataSource, UITableViewDelegate
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTUIKAppearance : NSObject
    
    typedef NS_ENUM(NSInteger, BTUIKColorScheme) {
        BTUIKColorSchemeLight,
        BTUIKColorSchemeDark,
        BTUIKColorSchemeDynamic API_AVAILABLE(ios(13.0))
    };
    
    /// Shared instance used by Form elements
    + (instancetype)sharedInstance;
    
    /// Fallback color for the overlay if blur is disabled
    @property (nonatomic, strong) UIColor *overlayColor;
    /// Tint color
    @property (nonatomic, strong) UIColor *tintColor;
    /// Bar color
    @property (nonatomic, strong) UIColor *barBackgroundColor;
    /// Font family
    @property (nonatomic, strong) NSString *fontFamily;
    /// Bold font family
    @property (nonatomic, strong) NSString *boldFontFamily;
    // Font, defaults to system font
    @property (nonatomic, strong, readonly) UIFont *font;
    // Bold font, defaults to system bold font
    @property (nonatomic, strong, readonly) UIFont *boldFont;
    /// Sheet background color
    @property (nonatomic, strong) UIColor *formBackgroundColor;
    /// Form field background color
    @property (nonatomic, strong) UIColor *formFieldBackgroundColor;
    /// Primary text color
    @property (nonatomic, strong) UIColor *primaryTextColor;
    /// Navigation title text color
    /// Defaults to nil. When not set, navigation titles will use primaryTextColor
    @property (nonatomic, strong) UIColor *navigationBarTitleTextColor;
    /// Secondary text color
    @property (nonatomic, strong) UIColor *secondaryTextColor;
    /// Color of disabled buttons
    @property (nonatomic, strong) UIColor *disabledColor;
    /// Placeholder text color for form fields
    @property (nonatomic, strong) UIColor *placeholderTextColor;
    /// Line and border color
    @property (nonatomic, strong) UIColor *lineColor;
    /// Error foreground color
    @property (nonatomic, strong) UIColor *errorForegroundColor;
    /// Blur style
    @property (nonatomic) UIBlurEffectStyle blurStyle;
    /// Activity indicator style
    @property (nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
    /// Toggle blur effects
    @property (nonatomic) BOOL useBlurs;
    /// The keyboard the postal code field should use
    @property (nonatomic) UIKeyboardType postalCodeFormFieldKeyboardType;
    /// The highlighted version of the `tintColor`
    @property (nonatomic, readonly, getter = highlightedTintColor) UIColor *highlightedTintColor;
    /// Tint color for UISwitch when in the on position
    @property (nonatomic, strong) UIColor *switchOnTintColor;
    /// Tint color for UISwitch thumb
    @property (nonatomic, strong) UIColor *switchThumbTintColor;
    /// Color scheme of the Drop-In UI.
    ///
    /// When set to BTUIKColorSchemeLight, the Drop-In UI uses a light color palette.
    /// When set to BTUIKColorSchemeDark, the Drop-In UI uses a dark color palette.
    /// When set to BTUIKColorSchemeDynamic, the Drop-In UI uses a dark or light color palette depending on the user's light or dark mode system preference. Only available in iOS 13+
    @property (nonatomic) enum BTUIKColorScheme colorScheme;
    /// Appearance style of keyboards associated with text fields
    @property (nonatomic) UIKeyboardAppearance keyboardAppearance;
    
    /// Sets the color (primary or secondary) and font with family and size (large or small)
    /// These properties are on the [BTUIKAppearance sharedInstance]
    + (void)styleLabelPrimary:(UILabel *)label;
    + (void)styleLabelBoldPrimary:(UILabel *)label;
    + (void)styleSmallLabelBoldPrimary:(UILabel *)label;
    + (void)styleSmallLabelPrimary:(UILabel *)label;
    + (void)styleLabelSecondary:(UILabel *)label;
    + (void)styleLargeLabelSecondary:(UILabel *)label;
    + (void)styleSystemLabelSecondary:(UILabel *)label;
    + (UILabel *)styledNavigationTitleLabel;
    
    + (float)horizontalFormContentPadding;
    + (float)formCellHeight;
    + (float)verticalFormSpace;
    + (float)verticalFormSpaceTight;
    + (float)verticalSectionSpace;
    + (float)smallIconWidth;
    + (float)smallIconHeight;
    + (float)largeIconWidth;
    + (float)largeIconHeight;
    + (NSDictionary*)metrics;
    
    @end

    Swift

    class BTUIKAppearance : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTUIKCardExpirationValidator : NSObject
    
    + (BOOL)month:(NSUInteger)month year:(NSUInteger)year validForDate:(NSDate *)date;
    
    @end

    Swift

    class BTUIKCardExpirationValidator : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTUIKCardExpiryFormat : NSObject
    @property (nonatomic, copy) NSString *value;
    @property (nonatomic, assign) NSUInteger cursorLocation;
    @property (nonatomic, assign) BOOL backspace;
    
    - (void)formattedValue:(NSString * __autoreleasing *)value cursorLocation:(NSUInteger *)cursorLocation;
    
    @end

    Swift

    class BTUIKCardExpiryFormat : NSObject
  • @class A UILabel that contains images representing multiple BTUIKPaymentOptionType’s

    See more

    Declaration

    Objective-C

    @interface BTUIKCardListLabel : UILabel

    Swift

    class BTUIKCardListLabel : UILabel
  • @class Form field to collect a card number.

    See more

    Declaration

    Objective-C

    @interface BTUIKCardNumberFormField : BTUIKFormField

    Swift

    class BTUIKCardNumberFormField : BTUIKFormField
  • Immutable card type

    See more

    Declaration

    Objective-C

    @interface BTUIKCardType : NSObject

    Swift

    class BTUIKCardType : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTUIKCardholderNameFormField : BTUIKFormField

    Swift

    class BTUIKCardholderNameFormField : BTUIKFormField
  • @class Form field to collect an expiration date.

    See more

    Declaration

    Objective-C

    @interface BTUIKExpiryFormField : BTUIKFormField <BTUIKExpiryInputViewDelegate>

    Swift

    class BTUIKExpiryFormField : BTUIKFormField, BTUIKExpiryInputViewDelegate
  • @class A UIView designed to be used as an inputView on a text field. This input view makes it possible to enter a valid expiration date with 2 taps by showing buttons for months and years.

    See more

    Declaration

    Objective-C

    @interface BTUIKExpiryInputView
        : UIView <UITextFieldDelegate, UICollectionViewDataSource,
                  UICollectionViewDelegateFlowLayout>

    Swift

    class BTUIKExpiryInputView : UIView, UITextFieldDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
  • @class A UIView containing a BTUIKTextField and other elements to be displayed as a form field. This class is meant to be extended but can be used as is for other generic form fields.

    See more

    Declaration

    Objective-C

    @interface BTUIKFormField : UIView <UITextFieldDelegate, UIKeyInput>

    Swift

    class BTUIKFormField : UIView, UITextFieldDelegate, UIKeyInput
  • @class Creates a toolbar with that can be used as an input accessory view.

    See more

    Declaration

    Objective-C

    @interface BTUIKInputAccessoryToolbar : UIToolbar

    Swift

    class BTUIKInputAccessoryToolbar : UIToolbar
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTUIKLocalizedString : NSObject
    
    #pragma mark Localization helpers
    
    + (void)setCustomTranslations:(NSArray *)locales;
    
    + (NSString *)insertIntoLocalizedString:(NSString *)string replacement:(NSString* )replacement;
    
    + (NSString *)insertIntoLocalizedString:(NSString *)string replacement:(NSString* )replacement token:(NSString *)token;
    
    #pragma mark Localizations
    
    + (NSString *)CARD_DETAILS_LABEL;
    + (NSString *)ENTER_CARD_DETAILS_HELP_LABEL;
    + (NSString *)VALID_CARD_ERROR_LABEL;
    + (NSString *)CARD_REQUIRED;
    + (NSString *)CARD_INVALID;
    + (NSString *)EXPIRATION_REQUIRED;
    + (NSString *)EXPIRATION_INVALID;
    + (NSString *)CVV_REQUIRED;
    + (NSString *)CVV_INVALID;
    + (NSString *)POSTAL_CODE_HELP_LABEL;
    + (NSString *)POSTAL_CODE_REQUIRED;
    + (NSString *)POSTAL_CODE_INVALID;
    + (NSString *)COUNTRY_CODE_REQUIRED;
    + (NSString *)COUNTRY_CODE_INVALID;
    + (NSString *)MOBILE_NUMBER_REQUIRED;
    + (NSString *)MOBILE_NUMBER_INVALID;
    + (NSString *)ENROLLMENT_WITH_SMS_HELP_LABEL;
    + (NSString *)SMS_CODE_REQUIRED;
    + (NSString *)SMS_CODE_INVALID;
    
    + (NSString *)CANCEL_ACTION;
    + (NSString *)RETRY_ACTION;
    + (NSString *)CONTINUE_ACTION;
    + (NSString *)ADD_CARD_ACTION;
    + (NSString *)DONE_ACTION;
    + (NSString *)EDIT_ACTION;
    + (NSString *)NEXT_ACTION;
    + (NSString *)TOP_LEVEL_ERROR_ALERT_VIEW_OK_BUTTON_TEXT;
    + (NSString *)EDIT_PAYMENT_METHOD;
    + (NSString *)THERE_WAS_AN_ERROR;
    + (NSString *)REVIEW_AND_TRY_AGAIN;
    + (NSString *)INVALID_LABEL;
    + (NSString *)YEAR_LABEL;
    + (NSString *)MONTH_LABEL;
    + (NSString *)OTHER_LABEL;
    + (NSString *)CREDIT_OR_DEBIT_CARD_LABEL;
    + (NSString *)RECENT_LABEL;
    + (NSString *)SELECT_PAYMENT_LABEL;
    + (NSString *)CONFIRM_ENROLLMENT_LABEL;
    + (NSString *)CONFIRM_ACTION;
    + (NSString *)ENTER_SMS_CODE_SENT_HELP_LABEL;
    + (NSString *)SMS_CODE_LABEL;
    + (NSString *)CARD_TYPE_GENERIC_CARD;
    + (NSString *)MOBILE_COUNTRY_CODE_LABEL;
    + (NSString *)SECURITY_CODE_LABEL;
    + (NSString *)CVV_FIELD_PLACEHOLDER;
    + (NSString *)CVC_FIELD_PLACEHOLDER;
    + (NSString *)CID_FIELD_PLACEHOLDER;
    + (NSString *)CVN_FIELD_PLACEHOLDER;
    + (NSString *)POSTAL_CODE_PLACEHOLDER;
    + (NSString *)MOBILE_NUMBER_LABEL;
    + (NSString *)EXPIRATION_DATE_LABEL;
    + (NSString *)CARD_NUMBER_PLACEHOLDER;
    + (NSString *)EXPIRY_PLACEHOLDER_FOUR_DIGIT_YEAR;
    + (NSString *)EXPIRY_PLACEHOLDER_TWO_DIGIT_YEAR;
    + (NSString *)CARDHOLDER_NAME_LABEL;
    + (NSString *)SAVE_CARD_LABEL;
    
    + (NSString *)PAYPAL;
    + (NSString *)CARD_TYPE_AMERICAN_EXPRESS;
    + (NSString *)CARD_TYPE_DISCOVER;
    + (NSString *)CARD_TYPE_DINERS_CLUB;
    + (NSString *)CARD_TYPE_MASTER_CARD;
    + (NSString *)CARD_TYPE_VISA;
    + (NSString *)CARD_TYPE_JCB;
    + (NSString *)CARD_TYPE_MAESTRO;
    + (NSString *)CARD_TYPE_UNION_PAY;
    + (NSString *)CARD_TYPE_HIPER;
    + (NSString *)CARD_TYPE_HIPERCARD;
    + (NSString *)BRANDING_COINBASE;
    + (NSString *)BRANDING_VENMO;
    + (NSString *)BRANDING_APPLE_PAY;
    + (NSString *)USE_DIFFERENT_PHONE_NUMBER_ACTION;
    + (NSString *)CARD_NOT_ACCEPTED_ERROR_LABEL;
    
    #pragma mark Development Strings (usually not localized)
    
    + (NSString *)DEV_SAMPLE_SMS_CODE_TITLE;
    + (NSString *)DEV_SAMPLE_SMS_CODE_INFO;
    
    @end

    Swift

    class BTUIKLocalizedString : NSObject
  • @class Form field to collect a mobile country code

    See more

    Declaration

    Objective-C

    @interface BTUIKMobileCountryCodeFormField : BTUIKFormField

    Swift

    class BTUIKMobileCountryCodeFormField : BTUIKFormField
  • @class Form field to collect a mobile phone number

    See more

    Declaration

    Objective-C

    @interface BTUIKMobileNumberFormField : BTUIKFormField

    Swift

    class BTUIKMobileNumberFormField : BTUIKFormField
  • @class A UIView containing the BTUIKVectorArtView for a BTUIKPaymentOptionType within a light border.

    See more

    Declaration

    Objective-C

    @interface BTUIKPaymentOptionCardView : UIView

    Swift

    class BTUIKPaymentOptionCardView : UIView
  • @class Form field to collect a postal code

    See more

    Declaration

    Objective-C

    @interface BTUIKPostalCodeFormField : BTUIKFormField

    Swift

    class BTUIKPostalCodeFormField : BTUIKFormField
  • @class Form field to collect a mobile country code

    See more

    Declaration

    Objective-C

    @interface BTUIKSecurityCodeFormField : BTUIKFormField

    Swift

    class BTUIKSecurityCodeFormField : BTUIKFormField
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTUIKSwitchFormField : UIView
    
    - (instancetype)initWithTitle:(NSString *)title;
    
    /// The switch
    @property (nonatomic, strong) UISwitch *switchControl;
    
    @end

    Swift

    class BTUIKSwitchFormField : UIView
  • @class A specialized text field that provides more granular callbacks than a standard UITextField as the user edits text

    See more

    Declaration

    Objective-C

    @interface BTUIKTextField : UITextField

    Swift

    class BTUIKTextField : UITextField
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTUIKUtil : NSObject
    
    /// Checks if a card number is Luhn valid
    ///
    /// @param cardNumber A string of numbers representing the card number
    ///
    /// @return True ic the cardNumber is Luhn valid. False otherwise.
    + (BOOL)luhnValid:(NSString *)cardNumber;
    
    /// Strips non-digit characters from a string.
    ///
    /// @param input The string to strip.
    ///
    /// @return The string stripped of non-digit characters, or `nil` if `input` is
    /// `nil`
    + (NSString *)stripNonDigits:(NSString *)input;
    
    /// Strips non-digit characters and '/' from a string.
    ///
    /// @param input The string to strip.
    ///
    /// @return The string stripped of non-digit characters and '/', or `nil` if `input` is
    /// `nil`
    + (NSString *)stripNonExpiry:(NSString *)input;
    
    @end

    Swift

    class BTUIKUtil : NSObject
  • Subclassed to easily draw vector art into a scaled UIView. Useful for using generated UIBezierPath code from PaintCode verbatim.

    See more

    Declaration

    Objective-C

    @interface BTUIKVectorArtView : UIView

    Swift

    class BTUIKVectorArtView : UIView
  • @class Utilities used by other views to get localized strings, a BTUIKPaymentOptionType or artwork

    See more

    Declaration

    Objective-C

    @interface BTUIKViewUtil : NSObject

    Swift

    class BTUIKViewUtil : NSObject