Skip to content

VojtaStavik/VSTextField

Repository files navigation

VSTextField

Dead simple drop-in subclass of UITextField with super easy number formatting.

Example usage for a real time SSN formatting:

Example with SSN formatting

How to use it?

Just place the VSTextField.swift file into your project and replace your current UITextField with it. Then set:

textField.setFormatting(formattingPattern: "##-##-##", replacementCharacter: "#")  
// all # will be replaced by numbers