UIView+Additions.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. //
  2. // UIView+Additions.h
  3. // iBee
  4. //
  5. //
  6. #import <Foundation/Foundation.h>
  7. #import <UIKit/UIKit.h>
  8. #import <QuartzCore/QuartzCore.h>
  9. @class CALayer,DMPageView;
  10. @interface UIView (Additions)
  11. /**
  12. * Shortcut for frame.origin.x.
  13. *
  14. * Sets frame.origin.x = left
  15. */
  16. @property (nonatomic) CGFloat left;
  17. /**
  18. * Shortcut for frame.origin.y
  19. *
  20. * Sets frame.origin.y = top
  21. */
  22. @property (nonatomic) CGFloat top;
  23. /**
  24. * Shortcut for frame.origin.x + frame.size.width
  25. *
  26. * Sets frame.origin.x = right - frame.size.width
  27. */
  28. @property (nonatomic) CGFloat right;
  29. /**
  30. * Shortcut for frame.origin.y + frame.size.height
  31. *
  32. * Sets frame.origin.y = bottom - frame.size.height
  33. */
  34. @property (nonatomic) CGFloat bottom;
  35. /**
  36. * Shortcut for frame.size.width
  37. *
  38. * Sets frame.size.width = width
  39. */
  40. @property (nonatomic) CGFloat width;
  41. /**
  42. * Shortcut for frame.size.height
  43. *
  44. * Sets frame.size.height = height
  45. */
  46. @property (nonatomic) CGFloat height;
  47. /**
  48. * Shortcut for center.x
  49. *
  50. * Sets center.x = centerX
  51. */
  52. @property (nonatomic) CGFloat centerX;
  53. /**
  54. * Shortcut for center.y
  55. *
  56. * Sets center.y = centerY
  57. */
  58. @property (nonatomic) CGFloat centerY;
  59. /**
  60. * Return the x coordinate on the screen.
  61. */
  62. @property (nonatomic, readonly) CGFloat ttScreenX;
  63. /**
  64. * Return the y coordinate on the screen.
  65. */
  66. @property (nonatomic, readonly) CGFloat ttScreenY;
  67. /**
  68. * Return the x coordinate on the screen, taking into account scroll views.
  69. */
  70. @property (nonatomic, readonly) CGFloat screenViewX;
  71. /**
  72. * Return the y coordinate on the screen, taking into account scroll views.
  73. */
  74. @property (nonatomic, readonly) CGFloat screenViewY;
  75. /**
  76. * Return the view frame on the screen, taking into account scroll views.
  77. */
  78. @property (nonatomic, readonly) CGRect screenFrame;
  79. /**
  80. * Shortcut for frame.origin
  81. */
  82. @property (nonatomic) CGPoint origin;
  83. /**
  84. * Shortcut for frame.size
  85. */
  86. @property (nonatomic) CGSize size;
  87. /**
  88. * Shortcut for layer.transfrom
  89. */
  90. -(void)removeAllSubviews;
  91. -(void)removeViewWithTag:(NSInteger)tag;
  92. -(void)removeViewWithTags:(NSArray *)tagArray;
  93. -(void)removeViewWithTagLessThan:(NSInteger)tag;
  94. -(void)removeViewWithTagGreaterThan:(NSInteger)tag;
  95. - (UIViewController *)selfViewController;
  96. -(UIView *)subviewWithTag:(NSInteger)tag;
  97. @end