Created
August 30, 2015 17:12
-
-
Save AlexanderBollbach/85fe725fb88c4cff7a5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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