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) {
2929
3030typedef void (^TextDidChangeblock)(NSString * _Nullable text, BOOL isFinished);
3131typedef void (^TextEditStatusChangeblock)(CRTextEditStatus editStatus);
32+ typedef NSString *(^TextCustomProcessblock)(NSString * _Nullable text);
3233
3334@interface CRBoxInputView : UIView
3435
@@ -110,6 +111,8 @@ default: @""
110111
111112@property (copy , nonatomic ) TextDidChangeblock _Nullable textDidChangeblock;
112113@property (copy , nonatomic ) TextEditStatusChangeblock _Nullable textEditStatusChangeblock;
114+ // / 文本自定义处理
115+ @property (copy , nonatomic ) TextCustomProcessblock _Nullable textCustomProcessblock;
113116@property (strong , nonatomic ) CRBoxFlowLayout * _Nullable boxFlowLayout;
114117@property (strong , nonatomic ) CRBoxInputCellProperty * _Nullable customCellProperty;
115118@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
301301 verStr = [verStr stringByReplacingOccurrencesOfString: @" " withString: @" " ];
302302 verStr = [self filterInputContent: verStr];
303303
304+ // 自定义处理
305+ if (self.textCustomProcessblock ) {
306+ verStr = self.textCustomProcessblock (verStr);
307+ }
308+
304309 if (verStr.length >= _codeLength) {
305310 verStr = [verStr substringToIndex: _codeLength];
306311 [self endEdit ];
You can’t perform that action at this time.
0 commit comments