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
CGContextRefand only draw line for new point, or - Use
UIMutablePathand add new line of point to the path, then stroke the path
But I found the problem:
- Re-use
CGContextRefdoes not work, why ? (ie I canUIGraphicsGetCurrentContext()indrawRectbut I cannot keep and use it outside the method) - Is redrawing the path as less efficient as redrawing using
CGContextRef?
Thanks!