File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ typedef NS_ENUM(NSInteger, CRInputType) {
29
29
30
30
typedef void (^TextDidChangeblock)(NSString * _Nullable text, BOOL isFinished);
31
31
typedef void (^TextEditStatusChangeblock)(CRTextEditStatus editStatus);
32
+ typedef NSString *(^TextCustomProcessblock)(NSString * _Nullable text);
32
33
33
34
@interface CRBoxInputView : UIView
34
35
@@ -110,6 +111,8 @@ default: @""
110
111
111
112
@property (copy , nonatomic ) TextDidChangeblock _Nullable textDidChangeblock;
112
113
@property (copy , nonatomic ) TextEditStatusChangeblock _Nullable textEditStatusChangeblock;
114
+ // / 文本自定义处理
115
+ @property (copy , nonatomic ) TextCustomProcessblock _Nullable textCustomProcessblock;
113
116
@property (strong , nonatomic ) CRBoxFlowLayout * _Nullable boxFlowLayout;
114
117
@property (strong , nonatomic ) CRBoxInputCellProperty * _Nullable customCellProperty;
115
118
@property (strong , nonatomic , readonly ) NSString * _Nullable textValue;
Original file line number Diff line number Diff line change @@ -301,6 +301,11 @@ - (void)baseTextDidChange:(UITextField *)textField manualInvoke:(BOOL)manualInvo
301
301
verStr = [verStr stringByReplacingOccurrencesOfString: @" " withString: @" " ];
302
302
verStr = [self filterInputContent: verStr];
303
303
304
+ // 自定义处理
305
+ if (self.textCustomProcessblock ) {
306
+ verStr = self.textCustomProcessblock (verStr);
307
+ }
308
+
304
309
if (verStr.length >= _codeLength) {
305
310
verStr = [verStr substringToIndex: _codeLength];
306
311
[self endEdit ];
You can’t perform that action at this time.
0 commit comments