YMCaptchaTextCellProperty.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. //
  2. // YMCaptchaTextCellProperty.h
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2023/5/5.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "YMCaptchaTextLineView.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef NS_ENUM(NSInteger, YMCaptchaTextSecurityType) {
  11. YMCaptchaTextSecuritySymbolType,
  12. YMCaptchaTextSecurityCustomViewType,
  13. };
  14. typedef UIView *_Nonnull(^CustomSecurityViewBlock)(void);
  15. typedef YMCaptchaTextLineView *_Nonnull(^CustomLineViewBlock)(void);
  16. typedef void(^ConfigCellShadowBlock)(CALayer *layer);
  17. @interface YMCaptchaTextCellProperty : NSObject <NSCopying>
  18. #pragma mark - UI
  19. /**
  20. cell边框宽度
  21. 默认:0.5
  22. */
  23. @property (nonatomic, assign) CGFloat borderWidth;
  24. /**
  25. cell边框颜色
  26. 状态:未选中状态时
  27. 默认:[UIColor colorWithRed:228/255.0 green:228/255.0 blue:228/255.0 alpha:1]
  28. */
  29. @property (nonatomic, copy) UIColor *cellBorderColorNormal;
  30. /**
  31. cell边框颜色
  32. 状态:选中状态时
  33. 默认:[UIColor colorWithRed:255/255.0 green:70/255.0 blue:62/255.0 alpha:1]
  34. */
  35. @property (nonatomic, copy) UIColor *cellBorderColorSelected;
  36. /**
  37. cell边框颜色
  38. 状态:填充文字后,未选中状态时
  39. 默认:nil
  40. */
  41. @property (nonatomic, copy) UIColor *__nullable cellBorderColorFilled;
  42. /**
  43. cell背景颜色
  44. 状态:无填充文字,未选中状态时
  45. 默认:[UIColor whiteColor]
  46. */
  47. @property (nonatomic, copy) UIColor *cellBgColorNormal;
  48. /**
  49. cell背景颜色
  50. 状态:选中状态时
  51. 默认:[UIColor whiteColor]
  52. */
  53. @property (nonatomic, copy) UIColor *cellBgColorSelected;
  54. /**
  55. cell背景颜色
  56. 状态:填充文字后,未选中状态时
  57. 默认:与cellBgColorFilled相同
  58. */
  59. @property (nonatomic, copy) UIColor *__nullable cellBgColorFilled;
  60. /**
  61. 光标颜色
  62. 默认: [UIColor colorWithRed:255/255.0 green:70/255.0 blue:62/255.0 alpha:1]
  63. */
  64. @property (nonatomic, copy) UIColor *cellCursorColor;
  65. /**
  66. 光标宽度
  67. 默认: 2
  68. */
  69. @property (nonatomic, assign) CGFloat cellCursorWidth;
  70. /**
  71. 光标高度
  72. 默认: 32
  73. */
  74. @property (nonatomic, assign) CGFloat cellCursorHeight;
  75. /**
  76. 圆角
  77. 默认: 4
  78. */
  79. @property (nonatomic, assign) CGFloat cornerRadius;
  80. #pragma mark - line
  81. /**
  82. 显示下划线
  83. 默认: NO
  84. */
  85. @property (nonatomic, assign) BOOL showLine;
  86. #pragma mark - label
  87. /**
  88. 字体/字号
  89. 默认:[UIFont systemFontOfSize:20];
  90. */
  91. @property (nonatomic, copy) UIFont *cellFont;
  92. /**
  93. 字体颜色
  94. 默认:[UIColor blackColor];
  95. */
  96. @property (nonatomic, copy) UIColor *cellTextColor;
  97. #pragma mark - Security
  98. /**
  99. 是否密文显示
  100. 默认:NO
  101. */
  102. @property (nonatomic, assign) BOOL ifShowSecurity;
  103. /**
  104. 密文符号
  105. 默认:✱
  106. 说明:只有ifShowSecurity=YES时,有效
  107. */
  108. @property (nonatomic, copy) NSString *securitySymbol;
  109. /**
  110. 密文类型
  111. 默认:YMCaptchaTextSecuritySymbolType
  112. 类型说明:
  113. YMCaptchaTextSecuritySymbolType 符号类型,根据securitySymbol,originValue的内容来显示
  114. YMCaptchaTextSecurityCustomViewType 自定义View类型,可以自定义密文状态下的图片,View
  115. */
  116. @property (nonatomic, assign) YMCaptchaTextSecurityType securityType;
  117. /**
  118. 保存当前显示的字符
  119. 若想一次性修改所有输入值,请使用 CRBoxInputView中的'reloadInputString'方法
  120. 禁止修改该值!!!(除非你知道该怎么使用它。)
  121. */
  122. @property (nonatomic, copy, readonly) NSString *originValue;
  123. - (void)setMyOriginValue:(NSString *)originValue;
  124. #pragma mark - Placeholder
  125. /**
  126. 占位符默认填充值
  127. 禁止修改该值!!!(除非你知道该怎么使用它。)
  128. */
  129. @property (nonatomic, strong) NSString *__nullable cellPlaceholderText;
  130. /**
  131. 占位符字体颜色
  132. 默认:[UIColor colorWithRed:114/255.0 green:126/255.0 blue:124/255.0 alpha:0.3];
  133. */
  134. @property (nonatomic, copy) UIColor *cellPlaceholderTextColor;
  135. /**
  136. 占位符字体/字号
  137. 默认:[UIFont systemFontOfSize:20];
  138. */
  139. @property (nonatomic, copy) UIFont *cellPlaceholderFont;
  140. #pragma mark - Block
  141. /**
  142. 自定义密文View回调
  143. */
  144. @property (nonatomic, copy) CustomSecurityViewBlock customSecurityViewBlock;
  145. /**
  146. 自定义下划线回调
  147. */
  148. @property (nonatomic, copy) CustomLineViewBlock customLineViewBlock;
  149. /**
  150. 自定义阴影回调
  151. */
  152. @property (nonatomic, copy) ConfigCellShadowBlock __nullable configCellShadowBlock;
  153. #pragma mark - Test
  154. @property (nonatomic, assign) NSInteger index;
  155. @end
  156. NS_ASSUME_NONNULL_END