Created
January 23, 2013 16:27
-
-
Save ntsh/4609129 to your computer and use it in GitHub Desktop.
Objective C procedure to draw a circle with Radius R
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) createCircle :(int) R | |
{ | |
CALayer *circleLayer = [CALayer layer]; | |
circleLayer.bounds = CGRectMake(0, 0, 2*R, 2*R); | |
circleLayer.position = self.view.center; | |
circleLayer.cornerRadius = R; | |
circleLayer.borderColor = [UIColor blackColor].CGColor; | |
circleLayer.borderWidth = 8; | |
[self.view.layer addSublayer:circleLayer]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment