Is there any way to get at the actual data of a CGPath, so it can be saved to a file and restored later?
And is there any documentation on how that data is structured?
I would like to write it as a string (like a SVG path string), or some way with the dictionary object and PList XML files, but I'll take what I can get!
There is a post about saving CGPathRef
s here. The guy is using CGPathApply
function to enumerate through the elements of the path:
static void saveApplier(void* info, const CGPathElement* element) {
...
}
...
NSMutableArray* a = [NSMutableArray arrayWithObject:[NSNumber numberWithBool:YES]];
CGPathApply(path, a, saveApplier);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With