#HyRoundMenuView
关于HyRoundMenuView灵感来自于JZMultiChoicesCircleButton
目录:
- 示例
- [如何使用本项目](#How to use this project)
- [HyRoundMenuView公有方法以及属性说明](#Public method and attribute description)
- [HyRoundMenuModel公有方法以及属性说明](#Public method and attribute description d)
Examples
示例:
How to use this project
如何使用本项目?
- step 1 -> 初始化
_menuView = [HyRoundMenuView shareInstance];
- step 2 -> 填充数据源
_data = @[
[HyRoundMenuModel title:@"FaceBook"
iconImage:[UIImage imageNamed:@"ICON_SNS_facebook"]
transitionType:HyRoundMenuModelTransitionTypeMenuEnlarge],
[HyRoundMenuModel title:@"Link"
iconImage:[UIImage imageNamed:@"ICON_SNS_Link"]
transitionType:HyRoundMenuModelTransitionTypeNormal],
[HyRoundMenuModel title:@"微信朋友圈"
iconImage:[UIImage imageNamed:@"ICON_SNS_Moment"]
transitionType:HyRoundMenuModelTransitionTypeMenuEnlarge],
[HyRoundMenuModel title:@"QQ"
iconImage:[UIImage imageNamed:@"ICON_SNS_QQ"]
transitionType:HyRoundMenuModelTransitionTypeMenuEnlarge],
[HyRoundMenuModel title:@"Twitter"
iconImage:[UIImage imageNamed:@"ICON_SNS_twitter"]
transitionType:HyRoundMenuModelTransitionTypeMenuEnlarge],
[HyRoundMenuModel title:@"微信"
iconImage:[UIImage imageNamed:@"ICON_SNS_Wechat"]
transitionType:HyRoundMenuModelTransitionTypeMenuEnlarge],
[HyRoundMenuModel title:@"微博"
iconImage:[UIImage imageNamed:@"ICON_SNS_Weibo"]
transitionType:HyRoundMenuModelTransitionTypeMenuEnlarge]
].mutableCopy;
- step 3 -> 自定义圆点图片等等...
HyRoundMenuModel *centerModel = [HyRoundMenuModel title:@"What you want to do?" iconImage:[UIImage imageNamed:@"SendRound"] transitionType:HyRoundMenuModelTransitionTypeNormal];
- 自定义圆点必须设置model的type属性为HyRoundMenuModelItmeTypeCenter,且只能有一个。
centerModel.type = HyRoundMenuModelItmeTypeCenter;
[_data addObject:centerModel];
- 设置好以上属性后add到数据源
- 最后赋值到
_menuView.dataSources
里
_menuView.dataSources = _data;
- done (更多属性设置请参考demo)
HyRoundMenuView public method and attribute description
HyRoundMenuView公有方法以及属性说明:
- 允许拖拽按钮 默认为->
YES
@property (nonatomic, assign) BOOL allowDrag;
- 允许按钮吸附在屏幕边缘 默认为->
YES
@property (nonatomic, assign) BOOL allowAdsorption
- 允许拖拽按钮选择itme时产生3D效果
@property (nonatomic, assign) BOOL allowEffect3D;
HyRoundMenuView
Delegate
@property (nonatomic, weak, nullable) id<HyRoundMenuViewDelegate> delegate;
- 动画类型
@property (nonatomic, assign) HyRoundMenuViewAnimationType animationType;
-
bigRadius/smallRadius 必须等于4
-
Bezier的大小必须和smallRadius*2的大小一样
-
建议用【PaintCode】来画想要的图形
@property (nonatomic, nullable, weak) UIBezierPath *customBigShapeBezierPath
- 小圆按钮半径
@property (nonatomic, assign) CGFloat smallRadius
- 大圆按钮半径
@property (nonatomic, assign) CGFloat bigRadius;
- 形状颜色
@property (nonatomic, copy , nonnull) UIColor *shapeColor;
- 模糊风格
@property (nonatomic, assign) UIBlurEffectStyle blurEffectStyle
- 背景视图类型
@property (nonatomic, assign) HyRoundMenuViewBackgroundViewType backgroundViewType
- 初始化方法
+(__nonnull instancetype) shareInstance
HyRoundMenuModel public method and attribute description
HyRoundMenuModel公有方法以及属性说明:
model
标题
@property (nonatomic, strong, nonnull) NSString *title
- 设置图标
@property (nonatomic, strong, nonnull) UIImage *iconImage
- 该属性默认为
HyRoundMenuModelItmeTypeDefault
@property (nonatomic, assign, ) HyRoundMenuModelItmeType type
- 转场方式类型
@property (nonatomic, assign, ) HyRoundMenuModelTransitionType transitionType
- 类方法快速生成对象
+ (__nonnull instancetype)title:(NSString * __nonnull)title
iconImage:(UIImage * __nonnull)image
transitionType:(HyRoundMenuModelTransitionType)transitionType