I need to draw lines based on data received from a server, and I tried to avoid redrawing the whole thing every time I receive a new point, so I thought about:
- Re-use
CGContextRef
and only draw line for new point, or - Use
UIMutablePath
and add new line of point to the path, then stroke the path
But I found the problem:
- Re-use
CGContextRef
does not work, why ? (ie I canUIGraphicsGetCurrentContext()
indrawRect
but I cannot keep and use it outside the method) - Is redrawing the path as less efficient as redrawing using
CGContextRef
?
Thanks!