单军华
2018-07-19 83b9d5c682b21d88133f24da0f94dd56bd79e687
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
//  DWBubbleMenuButton.h
//  DWBubbleMenuButtonExample
//
//  Created by Derrick Walker on 10/8/14.
//  Copyright (c) 2014 Derrick Walker. All rights reserved.
//
 
#import <UIKit/UIKit.h>
 
typedef NS_ENUM(NSUInteger, ExpansionDirection) {
    DirectionLeft = 0,
    DirectionRight,
    DirectionUp,
    DirectionDown
};
 
 
@class DWBubbleMenuButton;
 
@protocol DWBubbleMenuViewDelegate <NSObject>
 
@optional
- (void)bubbleMenuButtonWillExpand:(DWBubbleMenuButton *)expandableView;
- (void)bubbleMenuButtonDidExpand:(DWBubbleMenuButton *)expandableView;
- (void)bubbleMenuButtonWillCollapse:(DWBubbleMenuButton *)expandableView;
- (void)bubbleMenuButtonDidCollapse:(DWBubbleMenuButton *)expandableView;
 
@end
 
@interface DWBubbleMenuButton : UIView <UIGestureRecognizerDelegate>
 
@property (nonatomic, weak, readonly) NSArray *buttons;
@property (nonatomic, strong) UIView *homeButtonView;
@property (nonatomic, readonly) BOOL isCollapsed;
@property (nonatomic, weak) id <DWBubbleMenuViewDelegate> delegate;
 
// The direction in which the menu expands
@property (nonatomic) enum ExpansionDirection direction;
 
// Indicates whether the home button will animate it's touch highlighting, this is enabled by default
@property (nonatomic) BOOL animatedHighlighting;
 
// Indicates whether menu should collapse after a button selection, this is enabled by default
@property (nonatomic) BOOL collapseAfterSelection;
 
// The duration of the expand/collapse animation
@property (nonatomic) float animationDuration;
 
// The default alpha of the homeButtonView when not tapped
@property (nonatomic) float standbyAlpha;
 
// The highlighted alpha of the homeButtonView when tapped
@property (nonatomic) float highlightAlpha;
 
// The spacing between menu buttons when expanded
@property (nonatomic) float buttonSpacing;
 
// Initializers
- (id)initWithFrame:(CGRect)frame expansionDirection:(ExpansionDirection)direction;
 
// Public Methods
- (void)addButtons:(NSArray *)buttons;
- (void)addButton:(UIButton *)button;
- (void)showButtons;
- (void)dismissButtons;
 
@end