I am very new to Core Graphics, and I would like to know how it is possible to draw rings with gradients similar to the Apple Watch fitness app. I am trying to do this on an iOS app, as I think currently Core Graphics is not supported on WatchKit yet.
I found a very good tutorial on the following website to draw the rings.
http://makeapppie.com/2015/03/10/swift-swift-basic-core-graphics-for-the-ring-graph/
However I am trying to figure out how to add a gradient to the stroke color. So far based on what I have found there is no straight forward way to do this. In order to achieve this, I figured I need to find the answers to the following:
- Is there an API to create circular gradients in Core Graphics?
- Is it possible to apply the gradient as the stroke color in Core Graphics?
Thanks