DSPhoneNumberInputMask

public class DSPhoneNumberInputMask : DSInputMask

The DSPhoneNumberInputMask, when assigned to a DSTextField, will enforce use of an number pad for text entry and allows only digits to be entered and formatted. Only 10-digit phone numbers are allowed.

It’s recommended to use the DSPhoneNumberValidationRule along with this mask.

let textField = DSTextField()

textField.inputMask = DSPhoneNumberInputMask()
textField.addValidationRule(DSPhoneNumberValidationRule())
  • Only numbers are needed to enter a phone number.

    Declaration

    Swift

    public var keyboardType: UIKeyboardType? { get }