I have a bunch of paths defined like the following:
_shapeMutablePath = CGPathCreateMutable();
CGPathMoveToPoint(_shapeMutablePath, NULL, 95.97,36.29);
CGPathAddCurveToPoint(_shapeMutablePath, NULL, 96.02,29.11,90.75,23.00,83.54,21.40);
CGPathAddCurveToPoint(_shapeMutablePath, NULL, 62.64,66.59,64.11,66.96,65.66,67.12);
CGPathAddCurveToPoint(_shapeMutablePath, NULL, 74.52,68.04,82.49,62.03,83.47,53.69);
CGPathAddCurveToPoint(_shapeMutablePath, NULL, 83.57,52.83,83.59,51.98,83.54,51.15);
CGPathAddCurveToPoint(_shapeMutablePath, NULL, 90.74,49.56,96.01,43.45,95.97,36.29);
CGPathCloseSubpath(_shapeMutablePath);
Some of them I have to reuse quite frequently, so I was wondering what is the best way to store and retrieve this information? Is it possible to save it as a constant in my constants file?
The computing time to create a path is nothing compared to the time for drawing it on screen, so it shouldn’t be a problem to create it on-demand with a static method or something
Alternatively, you could make a static class that stores the different paths you want to re-use