FDTool.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. //
  2. // FDTool.h
  3. // timePicker
  4. //
  5. // Created by xuansa on 2017/1/10.
  6. // Copyright © 2017年 xuansa. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface FDTool : UIView
  11. /** 1.标题,default is nil */
  12. @property(nullable, nonatomic,copy) NSString *title;
  13. /** 2.字体,default is nil (system font 17 plain) */
  14. @property(null_resettable, nonatomic,strong) UIFont *font;
  15. /** 3.字体颜色,default is nil (text draws black) */
  16. @property(null_resettable, nonatomic,strong) UIColor *labelTitleColor;
  17. @property(null_resettable, nonatomic,strong) UIColor *buttonTitleColor;
  18. /** 4.按钮边框颜色颜色,default is RGB(205, 205, 205) */
  19. @property(null_resettable, nonatomic,strong) UIColor *borderButtonColor;
  20. @property(null_resettable, nonatomic,strong) UIColor *buttonBackgroundColor;
  21. /**
  22. * 1.初始化方法
  23. *
  24. * @param title <#title description#>
  25. * @param cancelButtonTitle <#cancelButtonTitle description#>
  26. * @param okButtonTitle <#okButtonTitle description#>
  27. * @param target <#target description#>
  28. * @param cancelAction <#cancelAction description#>
  29. * @param okAction <#okAction description#>
  30. *
  31. * @return <#return value description#>
  32. */
  33. - (instancetype)initWithTitle:(nullable NSString *)title
  34. cancelButtonTitle:(nullable NSString *)cancelButtonTitle
  35. okButtonTitle:(nullable NSString *)okButtonTitle
  36. addTarget:(nullable id)target
  37. cancelAction:(SEL)cancelAction
  38. okAction:(SEL)okAction;
  39. @end
  40. NS_ASSUME_NONNULL_END
  41. @interface UIView (FD)
  42. /**
  43. * 1.间隔X值
  44. */
  45. @property (nonatomic, assign) CGFloat x;
  46. /**
  47. * 2.间隔Y值
  48. */
  49. @property (nonatomic, assign) CGFloat y;
  50. /**
  51. * 3.宽度
  52. */
  53. @property (nonatomic, assign) CGFloat width;
  54. /**
  55. * 4.高度
  56. */
  57. @property (nonatomic, assign) CGFloat height;
  58. /**
  59. * 5.中心点X值
  60. */
  61. @property (nonatomic, assign) CGFloat centerX;
  62. /**
  63. * 6.中心点Y值
  64. */
  65. @property (nonatomic, assign) CGFloat centerY;
  66. /**
  67. * 7.尺寸大小
  68. */
  69. @property (nonatomic, assign) CGSize size;
  70. /**
  71. * 8.起始点
  72. */
  73. @property (nonatomic, assign) CGPoint origin;
  74. /**
  75. * 9.上 < Shortcut for frame.origin.y
  76. */
  77. @property (nonatomic) CGFloat top;
  78. /**
  79. * 10.下 < Shortcut for frame.origin.y + frame.size.height
  80. */
  81. @property (nonatomic) CGFloat bottom;
  82. /**
  83. * 11.左 < Shortcut for frame.origin.x.
  84. */
  85. @property (nonatomic) CGFloat left;
  86. /**
  87. * 12.右 < Shortcut for frame.origin.x + frame.size.width
  88. */
  89. @property (nonatomic) CGFloat right;
  90. /**
  91. * 1.添加边框
  92. *
  93. * @param color <#color description#>
  94. */
  95. - (void)addBorderColor:(nullable UIColor *)color;
  96. /**
  97. * 2.UIView 的点击事件
  98. *
  99. * @param target 目标
  100. * @param action 事件
  101. */
  102. - (void)addTarget:(nullable id)target
  103. action:(nullable SEL)action;
  104. @end