Draw a filled semicircle

What is the best method for drawing a filled (!) Semicircle in a UIView? I played with the CGContextAddArc function, but it does not seem to provide padding. Here's what I like to draw - two filled semicircles.

enter image description here

+6
source share
1 answer
CGContextBeginPath(gc); CGContextAddArc(gc, 100, 100, 50, -M_PI_2, M_PI_2, 1); CGContextClosePath(gc); // could be omitted CGContextSetFillColorWithColor(gc, [UIColor cyanColor].CGColor); CGContextFillPath(gc); 
+15
source

Source: https://habr.com/ru/post/912087/


All Articles