-
Notifications
You must be signed in to change notification settings - Fork 112
/
Copy pathDraggableVC.m
59 lines (48 loc) · 1.44 KB
/
DraggableVC.m
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
//
// DraggableVC.m
// VHBoomMenuButton
//
// Created by Nightonke on 2017/4/14.
// Copyright © 2017 Nightonke. All rights reserved.
//
#import "DraggableVC.h"
#import "BuilderManager.h"
#import <BoomMenuButton/BoomMenuButton.h>
@interface DraggableVC ()
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb;
@property (weak, nonatomic) IBOutlet UISwitch *draggableSwitch;
@property (weak, nonatomic) IBOutlet UISwitch *backgroundEffectSwitch;
@property (weak, nonatomic) IBOutlet UISwitch *shadowEffectSwitch;
@end
@implementation DraggableVC
- (void)viewDidLoad
{
[super viewDidLoad];
UIEdgeInsets edgeInsets = self.bmb.edgeInsetsInSuperView;
// Prevent the bmbs being dragged behind navigation bar.
edgeInsets.top += 66;
self.bmb.buttonEnum = VHButtonSimpleCircle;
self.bmb.piecePlaceEnum = VHPiecePlaceDOT_9_1;
self.bmb.buttonPlaceEnum = VHButtonPlaceSC_9_1;
self.bmb.edgeInsetsInSuperView = edgeInsets;
for (int i = 0; i < self.bmb.pieceNumber; i++)
{
[self.bmb addBuilder:[BuilderManager simpleCircleButtonBuilder]];
}
}
- (IBAction)onSwitchValueChanged:(UISwitch *)sender
{
if (sender == self.draggableSwitch)
{
self.bmb.draggable = sender.on;
}
else if (sender == self.backgroundEffectSwitch)
{
self.bmb.hasBackground = sender.on;
}
else if (sender == self.shadowEffectSwitch)
{
self.bmb.hasShadow = sender.on;
}
}
@end