Drawing half-circles with CoreGraphics
问题 I know how to draw lines and shapes with CGPath s . But I couldn't figure out how to draw this symbol for a circuit diagram What code should I write to get that half circle shape? This is what I have so far: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 5.0); CGContextSetStrokeColorWithColor(context, [UIColor blueColor].CGColor); CGContextMoveToPoint(context, 60, 80); CGContextAddLineToPoint(context, 120, 80);