1
    CAShapeLayer *circle = [CAShapeLayer layer];

    circle.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(x, y, 100, 100) cornerRadius:50].CGPath;

    // Configure the apperence of the circle
    circle.fillColor = [UIColor whiteColor].CGColor;
    circle.strokeColor = [UIColor darkGrayColor].CGColor;
    circle.lineWidth = 1.8;
    circle.lineDashPattern = @[@6, @3];
    // Add to parent layer
    [cell.layer addSublayer:circle];

I am using this code to draw a circle. Now, I want to use a gradient as stroke color. How can I do that?

Ali Sufyan
  • 2,038
  • 3
  • 17
  • 27
  • 1
    possible duplicate of [On OSX, how do I gradient fill a path stroke?](http://stackoverflow.com/questions/2737973/on-osx-how-do-i-gradient-fill-a-path-stroke) – Dima May 12 '14 at 08:44
  • @Dima I couldn't figure out how it would work. – Ali Sufyan May 12 '14 at 10:11

0 Answers0