Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自动填充只添加了最后一位 #46

Open
ducksone opened this issue Feb 9, 2021 · 0 comments
Open

自动填充只添加了最后一位 #46

ducksone opened this issue Feb 9, 2021 · 0 comments

Comments

@ducksone
Copy link

ducksone commented Feb 9, 2021

问题描述
收到短信验证码之后点击填充,只会将验证码最后一位填充进输入框

CRBoxInputView.m

  • (void)textDidChange:(UITextField *)textField
    NSString *subStr = [verStr substringWithRange:NSMakeRange(verStr.length - 1, 1)];
    [self->_valueArr addObject:subStr];
    [self delaySecurityProcess];
    自动填充的字符串是一长串。所以我看这里的逻辑应该只是一个一个写的

我扫尾调整了下 能适应项目
for (int i = (int)self->_oldLength; i < verStr.length; i ++) {
NSString *subStr = [verStr substringWithRange:NSMakeRange(i, 1)];
if ([self->_valueArr count] < _codeLength) {
[self->_valueArr addObject:subStr];
}
}
上线前测试设备没有装卡验证自动填充... 后边用户提到的问题

不过控件是真的很好用 谢谢作者

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant