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
| Property | Type | Default | Description |
|---|---|---|---|
font | UIFont | .systemFont(ofSize: 16) | Text font for all inputs |
textColor | UIColor | .label | Input text color |
placeholderColor | UIColor | .placeholderText | Placeholder text color |
tintColor | UIColor | .systemBlue | Cursor and selection highlight color |
keyboardAppearance | UIKeyboardAppearance | .default | Light 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
| Brand | CardBrand case | PAN format | CVV |
|---|---|---|---|
| Visa | .visa | 4-4-4-4 (16 digits) | 3 digits |
| Mastercard | .mastercard | 4-4-4-4 (16 digits) | 3 digits |
| American Express | .amex | 4-6-5 (15 digits) | 4 digits |
| Maestro | .maestro | 4-4-4-4 (16 digits) | 3 digits |
| Carte Bancaire | .carteBancaire | 4-4-4-4 (16 digits) | 3 digits |
| Oney | .oney | 4-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.
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
| Property | Type | Description |
|---|---|---|
panContainer | SecurePANContainer | PAN input + optional brand selector for co-branded cards |
cvvView | UIView | CVV / date-of-birth input |
expDateView | UIView | Expiry date (MM/YY) |
holderNameView | UIView | Cardholder 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.