CGPath as a string

Is there a way to get the actual CGPath data, so it can be saved to a file and restored later?

And is there any documentation on how this data is structured?

I would like to write it as a string (for example, an SVG path string) or in some way with a dictionary object and PList XML files, but I will take what I can get!

+6
source share
1 answer

There is a message about saving CGPathRef here . The guy uses the CGPathApply function to enumerate through path elements:

 static void saveApplier(void* info, const CGPathElement* element) { ... } ... NSMutableArray* a = [NSMutableArray arrayWithObject:[NSNumber numberWithBool:YES]]; CGPathApply(path, a, saveApplier); 
+3
source

Source: https://habr.com/ru/post/904283/


All Articles