UIView+ST.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // UIView+ST.h
  3. // Copyright © 2016年 ST. All rights reserved.
  4. //
  5. #import <UIKit/UIKit.h>
  6. @interface UIView (ST)
  7. /**
  8. * 1.间隔X值
  9. */
  10. @property (nonatomic, assign) CGFloat x;
  11. /**
  12. * 2.间隔Y值
  13. */
  14. @property (nonatomic, assign) CGFloat y;
  15. /**
  16. * 3.宽度
  17. */
  18. @property (nonatomic, assign) CGFloat width;
  19. /**
  20. * 4.高度
  21. */
  22. @property (nonatomic, assign) CGFloat height;
  23. /**
  24. * 5.中心点X值
  25. */
  26. @property (nonatomic, assign) CGFloat centerX;
  27. /**
  28. * 6.中心点Y值
  29. */
  30. @property (nonatomic, assign) CGFloat centerY;
  31. /**
  32. * 7.尺寸大小
  33. */
  34. @property (nonatomic, assign) CGSize size;
  35. /**
  36. * 8.起始点
  37. */
  38. @property (nonatomic, assign) CGPoint origin;
  39. /**
  40. * 9.上 < Shortcut for frame.origin.y
  41. */
  42. @property (nonatomic) CGFloat top;
  43. /**
  44. * 10.下 < Shortcut for frame.origin.y + frame.size.height
  45. */
  46. @property (nonatomic) CGFloat bottom;
  47. /**
  48. * 11.左 < Shortcut for frame.origin.x.
  49. */
  50. @property (nonatomic) CGFloat left;
  51. /**
  52. * 12.右 < Shortcut for frame.origin.x + frame.size.width
  53. */
  54. @property (nonatomic) CGFloat right;
  55. /**
  56. * 1.添加边框
  57. *
  58. * @param color <#color description#>
  59. */
  60. - (void)addBorderColor:(UIColor *)color;
  61. /**
  62. * 2.UIView 的点击事件
  63. *
  64. * @param target 目标
  65. * @param action 事件
  66. */
  67. - (void)addTarget:(id)target
  68. action:(SEL)action;
  69. @end