-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathEaseVC.m
More file actions
102 lines (79 loc) · 2.83 KB
/
EaseVC.m
File metadata and controls
102 lines (79 loc) · 2.83 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//
// EaseVC.m
// VHBoomMenuButton
//
// Created by Nightonke on 2017/4/14.
// Copyright © 2017 Nightonke. All rights reserved.
//
#import "EaseVC.h"
#import "BuilderManager.h"
#import <BoomMenuButton/BoomMenuButton.h>
@interface CustomTimeInterpolator : NSObject<VHTimeInterpolator>
@end
@implementation CustomTimeInterpolator
- (CGFloat)interpolation:(CGFloat)offset
{
return offset < 0.5 ? offset : MIN(offset * 1.5, 1);
}
@end
@interface EaseVC ()
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb1;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb2;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb3;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb4;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb5;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb6;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb7;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb8;
@property (weak, nonatomic) IBOutlet VHBoomMenuButton *bmb9;
@end
@implementation EaseVC
- (void)viewDidLoad
{
[super viewDidLoad];
[self initializeBMB:self.bmb1];
[self initializeBMB:self.bmb2];
[self initializeBMB:self.bmb3];
[self initializeBMB:self.bmb4];
[self initializeBMB:self.bmb5];
[self initializeBMB:self.bmb6];
[self initializeBMB:self.bmb7];
[self initializeBMB:self.bmb8];
[self initializeBMB:self.bmb9];
self.bmb1.boomDuration = 1;
self.bmb1.reboomDuration = 0.5;
self.bmb2.boomEaseName = VHEaseOutExpo;
self.bmb2.reboomEaseName = VHEaseInExpo;
self.bmb3.boomEaseName = VHEaseOutBounce;
self.bmb3.reboomEaseName = VHEaseOutBounce;
self.bmb4.boomEaseName = VHEaseOutElastic;
self.bmb4.reboomEaseName = VHEaseInElastic;
self.bmb4.delay = 0;
self.bmb5.boomEase = [CustomTimeInterpolator new];
self.bmb5.reboomEase = [CustomTimeInterpolator new];
self.bmb5.duration = 2;
self.bmb6.boomEaseName = VHEaseInCirc;
self.bmb6.reboomEaseName = VHEaseInCirc;
self.bmb7.boomEaseName = VHEaseOutCirc;
self.bmb7.reboomEaseName = VHEaseOutCirc;
self.bmb8.boomMoveEaseName = VHEaseInBack;
self.bmb8.boomRotateEaseName = VHEaseInBack;
self.bmb8.boomScaleEaseName = VHEaseLinear;
self.bmb8.reboomMoveEaseName = VHEaseInBack;
self.bmb8.reboomRotateEaseName = VHEaseInBack;
self.bmb8.reboomScaleEaseName = VHEaseInBack;
self.bmb9.boomEaseName = VHEaseInOutQuad;
self.bmb9.reboomEaseName = VHEaseInOutQuad;
self.bmb9.delay = 0;
}
- (void)initializeBMB:(VHBoomMenuButton *)bmb
{
bmb.buttonEnum = VHButtonSimpleCircle;
bmb.piecePlaceEnum = VHPiecePlaceDOT_9_1;
bmb.buttonPlaceEnum = VHButtonPlaceSC_9_1;
for (int i = 0; i < bmb.pieceNumber; i++)
{
[bmb addBuilder:[BuilderManager simpleCircleButtonBuilder]];
}
}
@end