增加ifClearAllInBeginEditing
This commit is contained in:
@@ -416,6 +416,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_boxInputView.ifClearAllInBeginEditing = YES;
|
||||||
[_boxInputView reloadInputString:@"5678"];
|
[_boxInputView reloadInputString:@"5678"];
|
||||||
|
|
||||||
return _boxInputView;
|
return _boxInputView;
|
||||||
|
|||||||
@@ -76,6 +76,13 @@ typedef void(^TextEditStatusChangeblock)(CRTextEditStatus editStatus);
|
|||||||
*/
|
*/
|
||||||
@property (strong, nonatomic) NSString * _Nullable placeholderText;
|
@property (strong, nonatomic) NSString * _Nullable placeholderText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
弹出键盘时,是否清空所有输入
|
||||||
|
只有在输入的字数等于codeLength时,生效
|
||||||
|
default: NO
|
||||||
|
*/
|
||||||
|
@property (assign, nonatomic) BOOL ifClearAllInBeginEditing;
|
||||||
|
|
||||||
@property (copy, nonatomic) TextDidChangeblock _Nullable textDidChangeblock;
|
@property (copy, nonatomic) TextDidChangeblock _Nullable textDidChangeblock;
|
||||||
@property (copy, nonatomic) TextEditStatusChangeblock _Nullable textEditStatusChangeblock;
|
@property (copy, nonatomic) TextEditStatusChangeblock _Nullable textEditStatusChangeblock;
|
||||||
@property (strong, nonatomic) CRBoxFlowLayout * _Nullable boxFlowLayout;
|
@property (strong, nonatomic) CRBoxFlowLayout * _Nullable boxFlowLayout;
|
||||||
|
|||||||
@@ -159,6 +159,10 @@ typedef NS_ENUM(NSInteger, CRBoxTextChangeType) {
|
|||||||
{
|
{
|
||||||
_ifNeedBeginEdit = YES;
|
_ifNeedBeginEdit = YES;
|
||||||
|
|
||||||
|
if (self.ifClearAllInBeginEditing && self.textValue.length == self.codeLength) {
|
||||||
|
[self clearAll];
|
||||||
|
}
|
||||||
|
|
||||||
if (self.textEditStatusChangeblock) {
|
if (self.textEditStatusChangeblock) {
|
||||||
self.textEditStatusChangeblock(CRTextEditStatus_BeginEdit);
|
self.textEditStatusChangeblock(CRTextEditStatus_BeginEdit);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user