Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CGPathRef encoding

Is it possible to encode CGPathRef variables? I mean is there an encodeObject:forKey like method for CGPathRef variables?

like image 286
cocoatoucher Avatar asked Apr 28 '26 16:04

cocoatoucher


2 Answers

yes, there is - I have done this: https://github.com/mro/MROGeometry/blob/master/NSCoder_MROCGPath.m

like image 70
Marcus Rohrmoser Avatar answered Apr 30 '26 07:04

Marcus Rohrmoser


CGPaths are objects, but I don't think you can encode them—at least, if you can, it's not documented. You'll need to generate a saveable representation of the path yourself, and encode that, and then, when you decode that representation, reincarnate the path from it yourself.

like image 37
Peter Hosey Avatar answered Apr 30 '26 05:04

Peter Hosey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!