手机验证码登录部分逻辑完善

This commit is contained in:
zu
2021-09-09 20:38:51 +08:00
parent 9574a71282
commit 8a4cfc2eb5
4 changed files with 26 additions and 9 deletions

View File

@@ -11,7 +11,7 @@
///
@interface LoginInputView ()
@interface LoginInputView () <UITextFieldDelegate>
///
@property (nonatomic,strong) UIStackView *stackView;
///
@@ -87,10 +87,19 @@
_textField.font = [UIFont systemFontOfSize:18.f];
_textField.borderStyle = UITextBorderStyleNone;
_textField.keyboardType = UIKeyboardTypeNumberPad;
_textField.tintColor = ThemeBackgroundColor;
_textField.tintColor = ThemeDefaultColor;
_textField.backgroundColor = [UIColor clearColor];
_textField.delegate = self;
}
return _textField;
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
return textField.text.length <= 11;
}
- (void)textFieldDidChangeSelection:(UITextField *)textField {
textField.text = [textField.text substringToIndex:MIN(textField.text.length, 11)];
}
@end