I want to change the color of the intersection of the two circles.
I now use this method:
- (void)drawRect:(CGRect)rect{
// draw circle 1
CGRect circle1=CGRectMake(100, 200, 80, 80);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextAddArc(ctx, CGRectGetMinX(circle1), CGRectGetMinY(circle1), CGRectGetWidth(circle1)/2, 0, 2*M_PI, 1);
CGContextSetFillColorWithColor(ctx, [UIColor blackColor].CGColor);
CGContextDrawPath(ctx, kCGPathFill);
// draw circle 2
CGRect circle2=CGRectMake(170, 200, 80, 80);
CGContextAddArc(ctx, CGRectGetMinX(circle2), CGRectGetMinY(circle2), CGRectGetWidth(circle2)/2, 0, 2*M_PI, 1);
CGContextSetFillColorWithColor(ctx, [UIColor blackColor].CGColor);
CGContextDrawPath(ctx, kCGPathFill);
// intersection Rect
CGRect intersectionRect=CGRectIntersection(circle1, circle2);
}
to get the intersection location, but what to do next?
As shown, I want to change the intersection of the two black circles to white.