Exporting SVG (XML) data for something like a six sided shape (hexagon) requires a piecemeal approach and very specific string needed for the XML to be rendered correctly:
svgData += "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"
svgData += "<svg width=\"\(viewWidth)\" height=\"\(viewHeight)\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n"
But there is also the addition of the obligatory prefix "M", followed by co-ordinate date, the postfixed "Z" finishing with path and colour data:
<path d=\"\(svgPathData)\" fill=\"\(randomColourSVG)\" /> \n
The trouble I ran into was the all important middling section that contained the x/y path data for multiple sides shapes.
Could this not simply be a method to pass through from UIBezierPath or CAShapeLayer so that Xcode does this for me, much like the convenience of .cgColor used after a UIColor ?
Basically, is SVG likely to get deeper integration ?