Open cemalsayin opened 4 years ago
you can use this method in "text field delegate"
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let maxLength = 19 let currentString: NSString = textField.text! as NSString let newString: NSString = currentString.replacingCharacters(in: range, with: string) as NSString return newString.length <= maxLength }
Hi everyone, i'm creating payment view with credit card and i create SkyFloatingLabelTextField for card number you know card number text length 16. I've built card form with textFieldDidChange function (which puts "-" after every 4 character). I mean my SkyFloatingLabelTextField's max character should be 19. how can i define it?