I have been trying to draw a gradient on a path similar to how it is done in the image below using either CALayers or CGContexts.
The path does not need to have a variable thickness or outline. It just needs the gradient on the path.
(source: sethtaylor.com)
I have been using the solution in the following answer Draw gradient along a curved UIBezierPath when my line was near straight. Now the line curves back on itself like in the image above and needs the stroke to be drawn along the path programmatically.
I am not quite sure where to start looking for this. What would you try?