Kevin

Merge pull request #28 from Lewuathe/update-circlechart

Continuous updating of PNCircleChart
... ... @@ -9,6 +9,12 @@
#import "PNCircleChart.h"
#import "UICountingLabel.h"
@interface PNCircleChart () {
UICountingLabel *_gradeLabel;
}
@end
@implementation PNCircleChart
... ... @@ -42,6 +48,8 @@
[self.layer addSublayer:_circle];
[self.layer addSublayer:_circleBG];
_gradeLabel = [[UICountingLabel alloc] initWithFrame:CGRectMake(0, 0, 50.0, 50.0)];
}
... ... @@ -53,16 +61,15 @@
{
//Add count label
UICountingLabel *gradeLabel = [[UICountingLabel alloc] initWithFrame:CGRectMake(0, 0, 50.0, 50.0)];
[gradeLabel setTextAlignment:NSTextAlignmentCenter];
[gradeLabel setFont:[UIFont boldSystemFontOfSize:13.0f]];
[gradeLabel setTextColor: PNDeepGrey];
[gradeLabel setCenter:CGPointMake(self.center.x,self.center.y)];
gradeLabel.method = UILabelCountingMethodEaseInOut;
gradeLabel.format = @"%d%%";
[_gradeLabel setTextAlignment:NSTextAlignmentCenter];
[_gradeLabel setFont:[UIFont boldSystemFontOfSize:13.0f]];
[_gradeLabel setTextColor: PNDeepGrey];
[_gradeLabel setCenter:CGPointMake(self.center.x,self.center.y)];
_gradeLabel.method = UILabelCountingMethodEaseInOut;
_gradeLabel.format = @"%d%%";
[self addSubview:gradeLabel];
[self addSubview:_gradeLabel];
//Add circle params
... ... @@ -80,7 +87,7 @@
[_circle addAnimation:pathAnimation forKey:@"strokeEndAnimation"];
_circle.strokeEnd = [_current floatValue]/[_total floatValue];
[gradeLabel countFrom:0 to:[_current floatValue]/[_total floatValue]*100 withDuration:1.0];
[_gradeLabel countFrom:0 to:[_current floatValue]/[_total floatValue]*100 withDuration:1.0];
}
... ...