UIView+CWChat.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // UIView+CWChat.h
  3. // CWChatDemo
  4. //
  5. // Created by chavez on 2017/8/10.
  6. // Copyright © 2017年 chavez. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #define UIColorFromRGBA(R,G,B,A) [UIColor colorWithRed: R /255.0 green: G /255.0 blue: B/255.0 alpha:A]
  10. #define kSelectBackGroudColor UIColorFromRGBA(83, 178, 232, 1.0)
  11. #define kNormalBackGroudColor UIColorFromRGBA(119, 119, 119, 1.0)
  12. @interface UIView (CWChat)
  13. @property (nonatomic) CGFloat cw_left;
  14. /**
  15. * Shortcut for frame.origin.y
  16. *
  17. * Sets frame.origin.y = top
  18. */
  19. @property (nonatomic) CGFloat cw_top;
  20. /**
  21. * Shortcut for frame.origin.x + frame.size.width
  22. *
  23. * Sets frame.origin.x = right - frame.size.width
  24. */
  25. @property (nonatomic) CGFloat cw_right;
  26. /**
  27. * Shortcut for frame.origin.y + frame.size.height
  28. *
  29. * Sets frame.origin.y = bottom - frame.size.height
  30. */
  31. @property (nonatomic) CGFloat cw_bottom;
  32. /**
  33. * Shortcut for frame.size.width
  34. *
  35. * Sets frame.size.width = width
  36. */
  37. @property (nonatomic) CGFloat cw_width;
  38. /**
  39. * Shortcut for frame.size.height
  40. *
  41. * Sets frame.size.height = height
  42. */
  43. @property (nonatomic) CGFloat cw_height;
  44. /**
  45. * Shortcut for center.x
  46. *
  47. * Sets center.x = centerX
  48. */
  49. @property (nonatomic) CGFloat cw_centerX;
  50. /**
  51. * Shortcut for center.y
  52. *
  53. * Sets center.y = centerY
  54. */
  55. @property (nonatomic) CGFloat cw_centerY;
  56. /**
  57. * Shortcut for frame.origin
  58. */
  59. @property (nonatomic) CGPoint cw_origin;
  60. /**
  61. * Shortcut for frame.size
  62. */
  63. @property (nonatomic) CGSize cw_size;
  64. //找到自己的vc
  65. - (UIViewController *)cw_viewController;
  66. @end