Quartz2D绘制小黄人
- (void)drawRect:(CGRect)rect
{
// 1.上下文
CGContextRef ctx = UIGraphicsGetCurrentContext();
// 2.身体
drawBody(ctx, rect);
// 3.嘴(微笑)
drawMouth(ctx, rect);
// 4.画眼睛
drawEyes(ctx, rect);
}
/**
* 眼睛
*/
void drawEyes(CGContextRef ctx, CGRect rect)
{
// 1.黑色绑带
CGFloat startX = rect<