CGPoint circleCenter = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 2); CGContextMoveToPoint(context, circleCenter.x, circleCenter.y); CGContextAddArc(context, circleCenter.x, circleCenter.y, 50, 90, 180, 0); CGContextAddLineToPoint(context, circleCenter.x, circleCenter.y); CGContextSetFillColorWithColor(context, [UIColor colorWithPatternImage:[UIImage imageNamed:@"add-icon.png"]].CGColor); CGContextFillPath(context); CGContextAddArc(context, circleCenter.x, circleCenter.y, 50, 180, 90, 0); CGContextAddLineToPoint(context, circleCenter.x, circleCenter.y); CGContextSetFillColorWithColor(context, [UIColor colorWithPatternImage:[UIImage imageNamed:@"appIcon_58.png"]].CGColor); CGContextFillPath(context);
source share