Skip to content

Instantly share code, notes, and snippets.

@AlexanderBollbach
Created August 30, 2015 17:12
Show Gist options
  • Save AlexanderBollbach/85fe725fb88c4cff7a5a to your computer and use it in GitHub Desktop.
Save AlexanderBollbach/85fe725fb88c4cff7a5a to your computer and use it in GitHub Desktop.
-(void)updateDrawingWithCount:(int)count {
int degree;
switch (self.beat) {
case beat1:
degree = 90;
break;
case beat2:
degree = 180;
break;
case beat3:
degree = 270;
break;
case beat4:
degree = 360;
break;
default:
break;
}
UIBezierPath* aPath = [UIBezierPath bezierPath];
[aPath moveToPoint:self.center];
[aPath addArcWithCenter:self.center
radius:20
startAngle:degreesToRadians(-90)
endAngle:degreesToRadians(degree-90)
clockwise:YES];
self.path = aPath.CGPath;
self.beat++;
if (self.beat > beat4) {
self.beat = beat1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment