title: Swift - how to draw a line where each point can have an individual colour
body: <p>How is it possible in Swift to draw a line where each point can have a different color?</p>
  
  <p>So let's say I have some data incoming which represents the color value of each dot in a line. How can I accomplish that? If I use UIBezierPath, I have a Path and I can only give the path a color. For my case, I have to make 600 Paths ( each dot a Path ) to get, what I would like to have.</p>
  
  <p>Is there a simpler way?</p>
  
  <p>Thank you very much!</p>
  
  <p>EDIT:
  I've tried to create a 1x1 UIBezierPath and a CAShapeLayer for each. It works, but the whole app gets very very slow, so there must be a simpler or faster method, does anyone know a solution?</p>