Create a subclass of uiview and implement drawRect
- (void)drawRect:(CGRect)rect {
CGRect circleRect = self.bounds;
CGFloat circleWidth = circleRect.size.width / 5.0;
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [[UIColor redColor] CGColor]);
CGContextFillEllipseInRect(context, circleRect);
circleRect = CGRectInset(circleRect, circleWidth, circleWidth);
CGContextSetFillColorWithColor(context, [[UIColor whiteColor] CGColor]);
CGContextFillEllipseInRect(context, circleRect);
circleRect = CGRectInset(circleRect, circleWidth, circleWidth);
CGContextSetFillColorWithColor(context, [[UIColor redColor] CGColor]);
CGContextFillEllipseInRect(context, circleRect);
}
Will draw
You should set you're views backgoundColor to [UIColor clearColor]
to make it not black around the edges.
You could also tweak this into a loop but that is the simplest example code i can show.
Note: I've not reused the colors, for simplicity of arc/nonarc code