Search code examples
swiftcalayercashapelayer

Convert CAShapelayers to SVG


Is there any way to convert a CAShapeLayer to a SVG image and export it in Swift?


Solution

  • A shape layer contains a CGPath. I searched on "convert CGPath to SVG" and found this (rather old) post that demonstrates converting a CGPath to an SVG:

    https://stackoverflow.com/a/22213852/205185