forked from Boris-Em/BEMSimpleLineGraph
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBEMAnimations.m
38 lines (33 loc) · 1.17 KB
/
BEMAnimations.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
//
// BEMAnimations.m
// SimpleLineGraph
//
// Created by Bobo on 12/27/13. Updated by Sam Spencer on 1/11/14.
// Copyright (c) 2013 Boris Emorine. All rights reserved.
// Copyright (c) 2014 Sam Spencer.
//
#import "BEMAnimations.h"
@implementation BEMAnimations
- (void)animationForDot:(NSInteger)dotIndex circleDot:(BEMCircle *)circleDot animationSpeed:(NSInteger)speed {
if (speed == 0) {
circleDot.alpha = 0;
} else {
[UIView animateWithDuration:0.5 delay:dotIndex/(speed*2.0) options:UIViewAnimationOptionCurveEaseOut animations:^{
circleDot.alpha = 0.7;
} completion:^(BOOL finished){
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
circleDot.alpha = 0;
} completion:nil];
}];
}
}
- (void)animationForLine:(NSInteger)lineIndex line:(BEMLine *)line animationSpeed:(NSInteger)speed {
if (speed == 0) {
line.alpha = 1.0;
} else {
[UIView animateWithDuration:1.0 delay:lineIndex/(speed*2.0) options:UIViewAnimationOptionCurveEaseOut animations:^{
line.alpha = 1.0;
} completion:nil];
}
}
@end