UIView+RQExtension.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // UIView+RQExtension.h
  3. // RQCommon
  4. //
  5. // Created by 张嵘 on 2018/11/16.
  6. // Copyright © 2018 张嵘. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UIView (RQExtension)
  10. #pragma mark - Gesture
  11. - (void)setTapActionWithBlock:(void (^)(UITapGestureRecognizer*tap))block;
  12. - (void)setLongPressActionWithBlock:(void (^)(UILongPressGestureRecognizer*longP))block;
  13. #pragma mark - Other
  14. /**
  15. * 判断一个控件是否真正显示在主窗口
  16. */
  17. - (BOOL)rq_isShowingOnKeyWindow;
  18. /**
  19. * xib创建的view
  20. */
  21. + (instancetype)rq_viewFromXib;
  22. /**
  23. * xib创建的view
  24. */
  25. + (instancetype)rq_viewFromXibWithFrame:(CGRect)frame;
  26. /**
  27. * xib中显示的属性
  28. */
  29. /// < Shortcut for frame.origin.x.
  30. @property (nonatomic, readwrite, assign) CGFloat rq_left;
  31. /// < Shortcut for frame.origin.y
  32. @property (nonatomic, readwrite, assign) CGFloat rq_top;
  33. /// < Shortcut for frame.origin.x + frame.size.width
  34. @property (nonatomic, readwrite, assign) CGFloat rq_right;
  35. /// < Shortcut for frame.origin.y + frame.size.height
  36. @property (nonatomic, readwrite, assign) CGFloat rq_bottom;
  37. /// < Shortcut for frame.origin.x.
  38. @property (nonatomic, readwrite, assign) CGFloat rq_x;
  39. /// < Shortcut for frame.origin.y
  40. @property (nonatomic, readwrite, assign) CGFloat rq_y;
  41. /// < Shortcut for frame.size.width
  42. @property (nonatomic, readwrite, assign) CGFloat rq_width;
  43. /// < Shortcut for frame.size.height
  44. @property (nonatomic, readwrite, assign) CGFloat rq_height;
  45. /// < Shortcut for center.x
  46. @property (nonatomic, readwrite, assign) CGFloat rq_centerX;
  47. ///< Shortcut for center.y
  48. @property (nonatomic, readwrite, assign) CGFloat rq_centerY;
  49. /// < Shortcut for frame.size.
  50. @property (nonatomic, readwrite, assign) CGSize rq_size;
  51. /// < Shortcut for frame.origin.
  52. @property (nonatomic, readwrite, assign) CGPoint rq_origin;
  53. @end