I am entering credit card information and I want the expiry date to be a max of 5 characters 4 numbers and a "/" automatically enters after the first two characters i.e. 01/17 after typing 01 the / is automatically entered, and allows only two more characters "17".
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool
{
if textField == expire{
}
return true
}
Aucun commentaire:
Enregistrer un commentaire