Dead simple drop-in subclass of UITextField with super easy number formatting.
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