123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- //
- // YMCaptchaTextCellProperty.h
- // MSYOUPAI
- //
- // Created by YoMi on 2023/5/5.
- //
- #import <Foundation/Foundation.h>
- #import "YMCaptchaTextLineView.h"
- NS_ASSUME_NONNULL_BEGIN
- typedef NS_ENUM(NSInteger, YMCaptchaTextSecurityType) {
- YMCaptchaTextSecuritySymbolType,
- YMCaptchaTextSecurityCustomViewType,
- };
- typedef UIView *_Nonnull(^CustomSecurityViewBlock)(void);
- typedef YMCaptchaTextLineView *_Nonnull(^CustomLineViewBlock)(void);
- typedef void(^ConfigCellShadowBlock)(CALayer *layer);
- @interface YMCaptchaTextCellProperty : NSObject <NSCopying>
- #pragma mark - UI
- /**
- cell边框宽度
- 默认:0.5
- */
- @property (nonatomic, assign) CGFloat borderWidth;
- /**
- cell边框颜色
- 状态:未选中状态时
- 默认:[UIColor colorWithRed:228/255.0 green:228/255.0 blue:228/255.0 alpha:1]
- */
- @property (nonatomic, copy) UIColor *cellBorderColorNormal;
- /**
- cell边框颜色
- 状态:选中状态时
- 默认:[UIColor colorWithRed:255/255.0 green:70/255.0 blue:62/255.0 alpha:1]
- */
- @property (nonatomic, copy) UIColor *cellBorderColorSelected;
- /**
- cell边框颜色
- 状态:填充文字后,未选中状态时
- 默认:nil
- */
- @property (nonatomic, copy) UIColor *__nullable cellBorderColorFilled;
- /**
- cell背景颜色
- 状态:无填充文字,未选中状态时
- 默认:[UIColor whiteColor]
- */
- @property (nonatomic, copy) UIColor *cellBgColorNormal;
- /**
- cell背景颜色
- 状态:选中状态时
- 默认:[UIColor whiteColor]
- */
- @property (nonatomic, copy) UIColor *cellBgColorSelected;
- /**
- cell背景颜色
- 状态:填充文字后,未选中状态时
- 默认:与cellBgColorFilled相同
- */
- @property (nonatomic, copy) UIColor *__nullable cellBgColorFilled;
- /**
- 光标颜色
- 默认: [UIColor colorWithRed:255/255.0 green:70/255.0 blue:62/255.0 alpha:1]
- */
- @property (nonatomic, copy) UIColor *cellCursorColor;
- /**
- 光标宽度
- 默认: 2
- */
- @property (nonatomic, assign) CGFloat cellCursorWidth;
- /**
- 光标高度
- 默认: 32
- */
- @property (nonatomic, assign) CGFloat cellCursorHeight;
- /**
- 圆角
- 默认: 4
- */
- @property (nonatomic, assign) CGFloat cornerRadius;
- #pragma mark - line
- /**
- 显示下划线
- 默认: NO
- */
- @property (nonatomic, assign) BOOL showLine;
- #pragma mark - label
- /**
- 字体/字号
- 默认:[UIFont systemFontOfSize:20];
- */
- @property (nonatomic, copy) UIFont *cellFont;
- /**
- 字体颜色
- 默认:[UIColor blackColor];
- */
- @property (nonatomic, copy) UIColor *cellTextColor;
- #pragma mark - Security
- /**
- 是否密文显示
- 默认:NO
- */
- @property (nonatomic, assign) BOOL ifShowSecurity;
- /**
- 密文符号
- 默认:✱
- 说明:只有ifShowSecurity=YES时,有效
- */
- @property (nonatomic, copy) NSString *securitySymbol;
- /**
- 密文类型
- 默认:YMCaptchaTextSecuritySymbolType
- 类型说明:
- YMCaptchaTextSecuritySymbolType 符号类型,根据securitySymbol,originValue的内容来显示
- YMCaptchaTextSecurityCustomViewType 自定义View类型,可以自定义密文状态下的图片,View
- */
- @property (nonatomic, assign) YMCaptchaTextSecurityType securityType;
- /**
- 保存当前显示的字符
- 若想一次性修改所有输入值,请使用 CRBoxInputView中的'reloadInputString'方法
- 禁止修改该值!!!(除非你知道该怎么使用它。)
- */
- @property (nonatomic, copy, readonly) NSString *originValue;
- - (void)setMyOriginValue:(NSString *)originValue;
- #pragma mark - Placeholder
- /**
- 占位符默认填充值
- 禁止修改该值!!!(除非你知道该怎么使用它。)
- */
- @property (nonatomic, strong) NSString *__nullable cellPlaceholderText;
- /**
- 占位符字体颜色
- 默认:[UIColor colorWithRed:114/255.0 green:126/255.0 blue:124/255.0 alpha:0.3];
- */
- @property (nonatomic, copy) UIColor *cellPlaceholderTextColor;
- /**
- 占位符字体/字号
- 默认:[UIFont systemFontOfSize:20];
- */
- @property (nonatomic, copy) UIFont *cellPlaceholderFont;
- #pragma mark - Block
- /**
- 自定义密文View回调
- */
- @property (nonatomic, copy) CustomSecurityViewBlock customSecurityViewBlock;
- /**
- 自定义下划线回调
- */
- @property (nonatomic, copy) CustomLineViewBlock customLineViewBlock;
- /**
- 自定义阴影回调
- */
- @property (nonatomic, copy) ConfigCellShadowBlock __nullable configCellShadowBlock;
- #pragma mark - Test
- @property (nonatomic, assign) NSInteger index;
- @end
- NS_ASSUME_NONNULL_END
|