DSCreditCardInputMask

public class DSCreditCardInputMask : DSInputMask

The DSCreditCardInputMask, when assigned to a DSTextField, will enforce use of a number pad for text entry and format credit card numbers if it recognizes the brand of the card being entered. (e.g., Visa, Mastercard, etc.)

It will also limit the number of characters based on the same rules.

let textField = DSTextField()

textField.inputMask = DSCreditCardInputMask()
  • Only numbers are needed to enter a credit card number.

    Declaration

    Swift

    public var keyboardType: UIKeyboardType? { get }