Created
November 14, 2012 17:45
-
-
Save arielelkin/4073608 to your computer and use it in GitHub Desktop.
Animating Slice of Donut
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
float radius = 300; | |
CAShapeLayer *donut = [CAShapeLayer layer]; | |
donut.bounds = CGRectMake(0,0,radius, radius); | |
donut.cornerRadius = radius/2; | |
donut.borderWidth = 2; | |
donut.borderColor = [UIColor redColor].CGColor; | |
[self.layer addSublayer:donut]; | |
CAShapeLayer *progressiveDonut = [CAShapeLayer layer]; | |
progressiveDonut.bounds = donut.bounds; | |
progressiveDonut.path = donut.path; | |
progressiveDonut.cornerRadius = donut.cornerRadius; | |
progressiveDonut.backgroundColor = nil; | |
progressiveDonut.strokeColor = [UIColor orangeColor].CGColor; | |
progressiveDonut.lineWidth = 4; | |
progressiveDonut.strokeStart = 0.0; | |
progressiveDonut.strokeEnd = 0.3; | |
progressiveDonut.lineJoin = kCALineJoinBevel; | |
progressiveDonut.borderWidth = 3; | |
progressiveDonut.borderColor = [UIColor blueColor].CGColor; | |
[self.layer addSublayer:progressiveDonut]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment