YOUPAIHWTFCursorView.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // YOUPAIHWTFCursorView.h
  3. // CodeTextDemo
  4. //
  5. // Created by 侯万 on 2018/12/13.
  6. // Copyright © 2018 小侯爷. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @protocol TFCodeViewDelegate <NSObject>
  10. -(void)youpaifinputFinished:(NSString *)inputStr;
  11. @end
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. 基础版 - 下划线 - 有光标
  15. */
  16. @interface YOUPAIHWTFCursorView : UIView
  17. // ----------------------------Data----------------------------
  18. /// 当前输入的内容
  19. @property (nonatomic, copy, readonly) NSString *code;
  20. @property(nonatomic,weak)id<TFCodeViewDelegate>delegate;
  21. @property (nonatomic, weak) UITextField *textField;
  22. // ----------------------------Method----------------------------
  23. - (instancetype)initWithCount:(NSInteger)count margin:(CGFloat)margin haveBorder:(BOOL)isHave;
  24. - (instancetype)init UNAVAILABLE_ATTRIBUTE;
  25. + (instancetype)new UNAVAILABLE_ATTRIBUTE;
  26. @end
  27. // ------------------------------------------------------------------------
  28. // -----------------------------HWCursorLabel------------------------------
  29. // ------------------------------------------------------------------------
  30. @interface HWCursorLabel : UILabel
  31. @property (nonatomic, weak, readonly) UIView *cursorView;
  32. - (void)startAnimating;
  33. - (void)stopAnimating;
  34. @end
  35. NS_ASSUME_NONNULL_END