VGSExpDateTextField

@MainActor
public final class VGSExpDateTextField : VGSTextField
extension VGSExpDateTextField: UIPickerViewDelegate, UIPickerViewDataSource

An object that displays an editable text area. Can be use instead of a VGSTextField when need to show picker view with Card Number Expiration Month and Year.

Overview: VGSExpDateTextField presents a month/year picker or keyboard for collecting card expiration date securely. It auto-validates against current month to prevent past dates and adapts its formatting based on configuration.

Features:

  • Month & year picker with customizable label formats (MonthFormat, YearFormat).
  • Prevents selection of expired month (auto-corrects if user navigates to past entry in current year).
  • Supports keyboard input fallback when configuration sets inputSource = .keyboard.
  • Integrates with VGSExpDateConfiguration for formatting & serialization, including tokenization scenarios.

Usage:

  1. Create text field and assign a VGSExpDateConfiguration (or tokenization configuration) to configuration before editing begins.
  2. Optionally set monthPickerFormat / yearPickerFormat for UI preferences.
  3. Read state for validation errors; submit through VGSCollect.

Accessibility:

  • Picker components inherit system traits; provide a meaningful placeholder so VoiceOver announces context.
  • Avoid exposing actual card number or other PII in any associated labels.

Performance:

  • Data source arrays are lightweight; picker updates only on relevant component changes.

Enums

Attributes