UIView+NTES.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // UIView+NTES.h
  3. // NIMDemo
  4. //
  5. // Created by ght on 15-1-31.
  6. // Copyright (c) 2015年 Netease. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UIView (NTES)
  10. @property (nonatomic) CGFloat left;
  11. /**
  12. * Shortcut for frame.origin.y
  13. *
  14. * Sets frame.origin.y = top
  15. */
  16. @property (nonatomic) CGFloat top;
  17. /**
  18. * Shortcut for frame.origin.x + frame.size.width
  19. *
  20. * Sets frame.origin.x = right - frame.size.width
  21. */
  22. @property (nonatomic) CGFloat right;
  23. /**
  24. * Shortcut for frame.origin.y + frame.size.height
  25. *
  26. * Sets frame.origin.y = bottom - frame.size.height
  27. */
  28. @property (nonatomic) CGFloat bottom;
  29. /**
  30. * Shortcut for frame.size.width
  31. *
  32. * Sets frame.size.width = width
  33. */
  34. @property (nonatomic) CGFloat width;
  35. /**
  36. * Shortcut for frame.size.height
  37. *
  38. * Sets frame.size.height = height
  39. */
  40. @property (nonatomic) CGFloat height;
  41. /**
  42. * Shortcut for center.x
  43. *
  44. * Sets center.x = centerX
  45. */
  46. @property (nonatomic) CGFloat centerX;
  47. /**
  48. * Shortcut for center.y
  49. *
  50. * Sets center.y = centerY
  51. */
  52. @property (nonatomic) CGFloat centerY;
  53. /**
  54. * Shortcut for frame.origin
  55. */
  56. @property (nonatomic) CGPoint origin;
  57. /**
  58. * Shortcut for frame.size
  59. */
  60. @property (nonatomic) CGSize size;
  61. //找到自己的vc
  62. - (UIViewController *)viewController;
  63. @end
  64. @interface UIView (NTESPresent)
  65. //弹出一个类似present效果的窗口
  66. - (void)presentView:(UIView*)view animated:(BOOL)animated complete:(void(^)(void)) complete;
  67. //获取一个view上正在被present的view
  68. - (UIView *)presentedView;
  69. - (void)dismissPresentedView:(BOOL)animated complete:(void(^)(void)) complete;
  70. //这个是被present的窗口本身的方法
  71. //如果自己是被present出来的,消失掉
  72. - (void)hideSelf:(BOOL)animated complete:(void(^)(void)) complete;
  73. @end