Bronze challenge help


#1

I’m trying to complete the bronze challenge using [path stroke] within the for loop but the circles will only print in one color. Can anyone help?

// Configure line width to 10 points
    [path setLineWidth:10];
    
    float red, green, blue;

    for (float currentRadius = maxRadius; currentRadius > 0; currentRadius -= 20) {
        
        red = 0.1 * (arc4random() % 11);
        green = 0.1 * (arc4random() % 11);
        blue = 0.1 * (arc4random() % 11);
        
        NSLog(@"Red: %f, Green: %f, Blue: %f", red, green, blue);
        [path moveToPoint:CGPointMake(center.x + currentRadius, center.y)];
        
        [path addArcWithCenter:center
                        radius:currentRadius
                    startAngle:0.0
                      endAngle:M_PI * 2.0
                     clockwise:YES];
        
        [self setCircleColor:[UIColor colorWithRed:red green:green blue:blue alpha:1.0]];
        
        [[self circleColor] setStroke];
        
        [path stroke];
    }

#2

Is path stroke required for this exercise?

I just lifted random color code from here mobile.tutsplus.com/tutorials/ip … plication/
And it worked just fine.