HyPopMenuView.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. //
  2. // HyPopMenuView.h
  3. // HyPopMenuView
  4. //
  5. // Created by H y on 15/9/8.
  6. // Copyright (c) 2015年 ouy.Aberi. All rights reserved.
  7. //
  8. #import "HyPopMenuViewDelegate.h"
  9. #import "PopMenuButton.h"
  10. #import "PopMenuModel.h"
  11. #import <UIKit/UIKit.h>
  12. /**
  13. * 弹出动画类型
  14. * animation Type
  15. */
  16. typedef NS_ENUM(NSUInteger, HyPopMenuViewAnimationType) {
  17. /**
  18. * 仿新浪App弹出菜单。
  19. * Sina App fake pop-up menu
  20. */
  21. HyPopMenuViewAnimationTypeSina,
  22. /**
  23. * 带有粘性的动画
  24. * Animation with viscous
  25. */
  26. HyPopMenuViewAnimationTypeViscous,
  27. /**
  28. * 底部中心点弹出动画
  29. * The bottom of the pop-up animation center
  30. */
  31. HyPopMenuViewAnimationTypeCenter,
  32. /**
  33. * 左和右弹出动画
  34. * Left and right pop Anime
  35. */
  36. HyPopMenuViewAnimationTypeLeftAndRight,
  37. };
  38. typedef enum : NSUInteger {
  39. /**
  40. * light模糊背景类型。
  41. * light blurred background type.
  42. */
  43. HyPopMenuViewBackgroundTypeLightBlur,
  44. /**
  45. * dark模糊背景类型。
  46. * dark blurred background type.
  47. */
  48. HyPopMenuViewBackgroundTypeDarkBlur,
  49. /**
  50. * 偏白半透明背景类型。
  51. * Partial white translucent background type.
  52. */
  53. HyPopMenuViewBackgroundTypeLightTranslucent,
  54. /**
  55. * 偏黑半透明背景类型。
  56. * Partial translucent black background type.
  57. */
  58. HyPopMenuViewBackgroundTypeDarkTranslucent,
  59. /**
  60. * 白~黑渐变色。
  61. * Gradient color.
  62. */
  63. HyPopMenuViewBackgroundTypeGradient,
  64. } HyPopMenuViewBackgroundType; //背景类型
  65. //Background type
  66. @interface HyPopMenuView : UIView
  67. /*=====================================================================================*/
  68. @property (nonatomic, retain) NSArray<PopMenuModel*>* dataSource;
  69. /**
  70. * 背景类型默认为 'HyPopMenuViewBackgroundTypeLightBlur'
  71. * The default is 'HyPopMenuViewBackgroundTypeLightBlur'
  72. */
  73. @property (nonatomic, assign) HyPopMenuViewBackgroundType backgroundType;
  74. /**
  75. * 动画类型
  76. * animation Type
  77. */
  78. @property (nonatomic, assign) HyPopMenuViewAnimationType animationType;
  79. /**
  80. * 自动识别颜色主题,默认为关闭。
  81. * The default is false.
  82. */
  83. @property (nonatomic, assign) BOOL automaticIdentificationColor;
  84. /**
  85. * HyPopMenuViewDelegate
  86. */
  87. @property (nonatomic, weak) id<HyPopMenuViewDelegate> delegate;
  88. /**
  89. * 默认为 10.0f 取值范围: 0.0f ~ 20.0f
  90. * default is 10.0f Range: 0 ~ 20
  91. */
  92. @property (nonatomic, assign) CGFloat popMenuSpeed;
  93. /**
  94. * 顶部自定义View
  95. */
  96. @property (nonatomic, strong) UIView* topView;
  97. + (instancetype)sharedPopMenuManager;
  98. - (void)openMenu;
  99. - (void)closeMenu;
  100. - (BOOL)isOpenMenu;
  101. @end
  102. UIKIT_EXTERN NSString* const HyPopMenuViewWillShowNotification;
  103. UIKIT_EXTERN NSString* const HyPopMenuViewDidShowNotification;
  104. UIKIT_EXTERN NSString* const HyPopMenuViewWillHideNotification;
  105. UIKIT_EXTERN NSString* const HyPopMenuViewDidHideNotification;