File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ - (void)viewDidLoad {
32
32
// self.graphView.barWidth = 22;
33
33
// self.graphView.barHeight = 140;
34
34
// self.graphView.marginBar = 25;
35
+ // self.graphView.animationDuration = 2.0;
35
36
36
- self.graphView .animationDuration = 2.0 ;
37
37
self.graphView .dataSource = self;
38
38
39
39
[self .graphView draw ];
Original file line number Diff line number Diff line change 12
12
13
13
#import " UIColor+GraphKit.h"
14
14
15
+ static CFTimeInterval kDefaultAnimationDuration = 1.0 ;
16
+
15
17
@interface GKBar ()
16
18
17
19
@property (atomic , assign ) BOOL animationInProgress;
@@ -47,7 +49,7 @@ - (id)initWithFrame:(CGRect)frame {
47
49
48
50
- (void )_init {
49
51
self.animated = YES ;
50
- self.animationDuration = 0.5 ;
52
+ self.animationDuration = kDefaultAnimationDuration ;
51
53
self.clipsToBounds = YES ;
52
54
self.cornerRadius = 2.0 ;
53
55
self.foregroundColor = [UIColor gk_turquoiseColor ];
Original file line number Diff line number Diff line change 26
26
@property (nonatomic , assign ) CGFloat marginBar;
27
27
28
28
- (void )draw ;
29
- // - (void)construct;
30
- // - (instancetype)draw;
31
29
- (void )reset ;
32
30
33
31
@end
Original file line number Diff line number Diff line change 19
19
static CGFloat kDefaultLabelWidth = 40 ;
20
20
static CGFloat kDefaultLabelHeight = 15 ;
21
21
22
+ static CGFloat kDefaultAnimationDuration = 2.0 ;
23
+
22
24
@implementation GKBarGraph
23
25
24
26
- (id )initWithCoder : (NSCoder *)aDecoder {
@@ -39,6 +41,7 @@ - (id)initWithFrame:(CGRect)frame {
39
41
}
40
42
41
43
- (void )_init {
44
+ self.animationDuration = kDefaultAnimationDuration ;
42
45
self.barHeight = kDefaultBarHeight ;
43
46
self.barWidth = kDefaultBarWidth ;
44
47
self.marginBar = kDefaultBarMargin ;
@@ -66,11 +69,11 @@ - (void)setBarColor:(UIColor *)color {
66
69
}
67
70
68
71
- (void )draw {
69
- [self construct ];
72
+ [self _construct ];
70
73
[self _drawBars ];
71
74
}
72
75
73
- - (void )construct {
76
+ - (void )_construct {
74
77
NSAssert (self.dataSource, @" GKBarGraph : No data source is assgined." );
75
78
76
79
if ([self _hasBars ]) [self _removeBars ];
@@ -83,10 +86,6 @@ - (void)construct {
83
86
[self _positionLabels ];
84
87
}
85
88
86
- // - (void)_construct {
87
- //
88
- // }
89
-
90
89
- (BOOL )_hasBars {
91
90
return ![self .bars mk_isEmpty ];
92
91
}
You can’t perform that action at this time.
0 commit comments