Skip to content

Instantly share code, notes, and snippets.

@baobao
Last active December 7, 2018 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baobao/6ed343edd8ca7fa4630e to your computer and use it in GitHub Desktop.
Save baobao/6ed343edd8ca7fa4630e to your computer and use it in GitHub Desktop.
CoreGraphicsテスト2
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
//塗りつぶしカラーを選択
CGContextSetRGBFillColor(context, 100, 0, 30, 1);
//ラインのカラーを選択
CGContextSetRGBStrokeColor(context, 255, 255, 255, 1);
UIBezierPath *path = [UIBezierPath bezierPath];
path.lineWidth = 4;
[path moveToPoint:CGPointMake(160, 20)];
[path addLineToPoint:CGPointMake(260, 340)];
[path addArcWithCenter:CGPointMake(160, 340) radius:100 startAngle:0 endAngle:M_PI clockwise:YES];
[path closePath];
[path fill];
[path stroke];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment