originValue封闭

This commit is contained in:
BearXR
2020-01-20 15:51:05 +08:00
parent da93c8a63b
commit aa32bd377b
3 changed files with 16 additions and 3 deletions

View File

@@ -141,7 +141,8 @@ typedef void(^ConfigCellShadowBlock)(CALayer *layer);
若想一次性修改所有输入值,请使用 CRBoxInputView中的'reloadInputString'方法 若想一次性修改所有输入值,请使用 CRBoxInputView中的'reloadInputString'方法
禁止修改该值!!!(除非你知道该怎么使用它。) 禁止修改该值!!!(除非你知道该怎么使用它。)
*/ */
@property (copy, nonatomic) NSString *originValue; @property (copy, nonatomic, readonly) NSString *originValue;
- (void)setMyOriginValue:(NSString *)originValue;
/** /**
密文类型 密文类型

View File

@@ -9,6 +9,13 @@
#import "CRBoxInputCellProperty.h" #import "CRBoxInputCellProperty.h"
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
@interface CRBoxInputCellProperty ()
@property (copy, nonatomic, readwrite) NSString *originValue;
@end
@implementation CRBoxInputCellProperty @implementation CRBoxInputCellProperty
- (instancetype)init - (instancetype)init
@@ -142,4 +149,9 @@
return customSecurityView; return customSecurityView;
} }
#pragma mark - Setter
- (void)setMyOriginValue:(NSString *)originValue {
_originValue = originValue;
}
@end @end

View File

@@ -389,9 +389,9 @@ typedef NS_ENUM(NSInteger, CRBoxTextChangeType) {
// setOriginValue // setOriginValue
NSUInteger focusIndex = _valueArr.count; NSUInteger focusIndex = _valueArr.count;
if (_valueArr.count > 0 && indexPath.row <= focusIndex - 1) { if (_valueArr.count > 0 && indexPath.row <= focusIndex - 1) {
cellProperty.originValue = _valueArr[indexPath.row]; [cellProperty setMyOriginValue:_valueArr[indexPath.row]];
}else{ }else{
cellProperty.originValue = @""; [cellProperty setMyOriginValue:@""];
} }
cell.boxInputCellProperty = cellProperty; cell.boxInputCellProperty = cellProperty;