WXHCodeView.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // WXHCodeView.h
  3. // xh_textfield
  4. //
  5. // Created by 路 on 2019/10/24.
  6. // Copyright © 2019年 路. All rights reserved.
  7. // https://github.com/568071718/xh_textfield
  8. #import <UIKit/UIKit.h>
  9. #import "WXHCodeViewDefaultItem.h"
  10. @class WXHCodeView;
  11. @protocol WXHCodeViewDelegate <NSObject>
  12. @optional
  13. - (void)codeView:(WXHCodeView *)codeView fullText:(NSString *)fullText;
  14. - (void)codeViewShouldReturn:(WXHCodeView *)codeView;
  15. @end
  16. @interface WXHCodeView : UIView
  17. - (id)initWithNumberOfItem:(NSUInteger)number;
  18. - (id)initWithNumberOfItem:(NSUInteger)number itemClass:(Class)aClass;
  19. @property (assign ,nonatomic) CGFloat spacing; // 默认: 10
  20. @property (assign ,nonatomic) UIEdgeInsets edgeInsets; // 默认: UIEdgeInsetsMake(0, 0, 0, 0);
  21. @property (weak ,nonatomic) IBOutlet id <WXHCodeViewDelegate>delegate;
  22. @property (nonatomic) UIKeyboardType keyboardType;
  23. @property (nonatomic) UIReturnKeyType returnKeyType;
  24. @property (strong ,readwrite) UIView *inputView;
  25. @property (strong ,readwrite) UIView *inputAccessoryView;
  26. @property (strong ,nonatomic ,readonly) NSArray <UIView <WXHCodeViewItem>*>*items;
  27. - (NSString *)text;
  28. @end