Skip to main content

Customize

Style the card fields, restrict accepted brands, and configure privacy behavior. All configuration is passed to SecureFieldsConfig at initialization — the SDK has no runtime API to change styles or placeholders after SecureFieldsManager is created.

Apply styles

Pass a SecureFieldsStyle in SecureFieldsConfig. Styles are applied to all fields at once.

SecureFieldsConfig(
tenantId: "${TENANT_ID}",
environment: .sandbox,
style: SecureFieldsStyle(
font: UIFont.systemFont(ofSize: 16, weight: .regular),
textColor: UIColor.label,
placeholderColor: UIColor.placeholderText,
tintColor: UIColor.systemBlue,
keyboardAppearance: .default
)
)

Style properties

PropertyTypeDefaultDescription
fontUIFont.systemFont(ofSize: 16)Text font for all inputs
textColorUIColor.labelInput text color
placeholderColorUIColor.placeholderTextPlaceholder text color
tintColorUIColor.systemBlueCursor and selection highlight color
keyboardAppearanceUIKeyboardAppearance.defaultLight or dark keyboard

Set placeholders

Pass a SecureFieldsPlaceholders in SecureFieldsConfig:

SecureFieldsConfig(
tenantId: "${TENANT_ID}",
environment: .sandbox,
placeholders: SecureFieldsPlaceholders(
pan: "1234 5678 9012 3456",
cvv: "CVV",
expDate: "MM/YY",
holderName: "Cardholder name"
)
)

Restrict accepted brands

Pass brands in SecureFieldsConfig to limit which card networks are accepted. The SDK filters BIN lookup results against this list.

SecureFieldsConfig(
tenantId: "${TENANT_ID}",
environment: .sandbox,
brands: [.visa, .mastercard, .carteBancaire, .oney]
)

Supported brands

BrandCardBrand casePAN formatCVV
Visa.visa4-4-4-4 (16 digits)3 digits
Mastercard.mastercard4-4-4-4 (16 digits)3 digits
American Express.amex4-6-5 (15 digits)4 digits
Maestro.maestro4-4-4-4 (16 digits)3 digits
Carte Bancaire.carteBancaire4-4-4-4 (16 digits)3 digits
Oney.oney4-4-4-4-3 (19 digits)Date of birth

PAN length and CVV length are driven by the BIN lookup API response, not hardcoded in the SDK. CardBrand.allCases is the default if brands is omitted.

Oney switches CVV to a date picker

When .oney is the selected brand, the CVV field switches to date-of-birth input mode (a date picker, stored as YYYY-MM-DD). The tokenization request sends birthDate instead of cvv for that submission.

Layout

Each field is exposed as an opaque UIView. Embed them anywhere in your view hierarchy — Auto Layout or frame-based layout both work. Fields typically look correct at a height of 44–56pt.

view.addSubview(secureFields.panContainer) // SecurePANContainer: UIView, includes brand selector
view.addSubview(secureFields.cvvView) // UIView
view.addSubview(secureFields.expDateView) // UIView
view.addSubview(secureFields.holderNameView) // UIView
PropertyTypeDescription
panContainerSecurePANContainerPAN input + optional brand selector for co-branded cards
cvvViewUIViewCVV / date-of-birth input
expDateViewUIViewExpiry date (MM/YY)
holderNameViewUIViewCardholder name (free text)

The underlying UITextField subclasses are internal to the SDK and cannot be accessed through any cast.

Privacy overlay

The SDK automatically places a UIBlurEffect overlay over all card fields when the app enters the background or screen recording starts, preventing card numbers from appearing in app-switcher thumbnails or screen recordings.

This is on by default. Disable it only if your app handles backgrounding separately:

secureFields.obscuresOnBackground = false

See Security and compliance for the full list of privacy protections.