verification code field: improved user experience (#1325)

pull/1/head
nixnuex 9 years ago committed by Michael Kirk
parent c7ee430790
commit 50cd4f54fc

@ -274,12 +274,12 @@
return NO; return NO;
} }
if (range.length == 0 && range.location == 3) { if (range.length == 0 && range.location == 2) {
textField.text = [NSString stringWithFormat:@"%@-%@", textField.text, string]; textField.text = [NSString stringWithFormat:@"%@%@-", textField.text, string];
return NO; return NO;
} }
if (range.length == 1 && range.location == 4) { if (range.length == 1 && range.location == 3) {
range.location--; range.location--;
range.length = 2; range.length = 2;
textField.text = [textField.text stringByReplacingCharactersInRange:range withString:@""]; textField.text = [textField.text stringByReplacingCharactersInRange:range withString:@""];

Loading…
Cancel
Save