title: how to create a path using coregraphics?
body: <p>i want to create a path.something like i touch the screen and draw line in touchmove event.when line intersect from starting point.fill that path using any colour.</p>
  
  <p><a href="https://i.stack.imgur.com/kcRhS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kcRhS.png" alt="alt text"></a>
  </p>
  
  <p>now see in the image i've drawn a line.i just want to detect if line intersects again to start point.then fill that path with my own desired color.also i m using core graphics to draw line but it's very slow on real device.could you tell me a way to improve speed?</p>