Skip to content

Instantly share code, notes, and snippets.

@ntsh
Created January 23, 2013 16:27
Show Gist options
  • Save ntsh/4609129 to your computer and use it in GitHub Desktop.
Save ntsh/4609129 to your computer and use it in GitHub Desktop.
Objective C procedure to draw a circle with Radius R
-(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