SelectBoxView.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // SelectBoxView.h
  3. // WebSocketDemo
  4. //
  5. // Created by 刘云鸽 on 2019/2/27.
  6. // Copyright © 2019年 liuyunge. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. /**
  10. IBInspectable和IB_DESIGNABLE
  11. 是方便Xib 预览的作用
  12. */
  13. @class SelectBoxView;
  14. @protocol SelectBoxViewDelegate<NSObject>
  15. @optional
  16. -(void)selectBoxView:(SelectBoxView *)boxView selectedIndex:(NSInteger)selectedIndex;
  17. @end
  18. @interface SelectBoxView : UIView
  19. /**
  20. 标题名
  21. */
  22. @property(nonatomic,strong) NSString *title;
  23. /**
  24. 标题颜色
  25. */
  26. @property(nonatomic,strong)UIColor *titleColor;
  27. /**
  28. 标题字体大小
  29. */
  30. @property(nonatomic,assign)CGFloat titleFontSize;
  31. /**
  32. 视图圆角
  33. */
  34. @property(nonatomic,assign)CGFloat cornerRadius;
  35. /**
  36. 视图边框颜色
  37. */
  38. @property(nonatomic,strong)UIColor *borderColor;
  39. /**
  40. 边框宽度
  41. */
  42. @property(nonatomic,assign)CGFloat borderWidth;
  43. /**
  44. cell高度
  45. */
  46. @property(nonatomic,assign)CGFloat rowHeight;
  47. /**
  48. 数据源
  49. */
  50. @property(nonatomic,strong)NSMutableArray *dataSource;
  51. /**
  52. 标题控件
  53. */
  54. @property (nonatomic, strong) UILabel *titleLabel;
  55. /**
  56. 右边箭头图片
  57. */
  58. @property (nonatomic, strong) UIImageView *rightImageView;
  59. /**
  60. 控件透明按钮,也可以给控件加手势
  61. */
  62. @property (nonatomic, strong) UIButton *maskBtn;
  63. /**
  64. 选项列表
  65. */
  66. @property (nonatomic, strong) UITableView *tableView;
  67. /**
  68. 蒙版
  69. */
  70. @property (nonatomic, strong) UIButton *backgroundBtn;
  71. /**
  72. tableView的高度
  73. */
  74. @property (nonatomic, assign) CGFloat tableViewHeight;
  75. @property (nonatomic, assign) BOOL isDirectionUp;
  76. @property(nonatomic,weak) id<SelectBoxViewDelegate> delegate;
  77. @property(nonatomic,copy) void(^selectedBlock)(SelectBoxView *boxView,NSInteger selectedIndex);
  78. -(instancetype)initWithFrame:(CGRect)frame dataSource:(NSMutableArray *)dataSource;
  79. @end