Skip to content
destman edited this page Apr 17, 2012 · 2 revisions

Main target of that project - render simple SVG files at iOS devices.

How it works:

  1. To remove all not used data from SVG xml - they are converted to binary format (protocol buffer used atm). Also this binary data loading abit faster. But compressed abit less then original svg file. To do that - there is console tool called svg2pb in project.

  2. In application that binay data is loaded in memory and rendered to given Core Grapgics context. You can use SVGRender class (it is made as a struct to integrate it with other pure Obj-C code) to do that. There are some classes that show how it works (SVGView, SVGButton).

  3. Sometimes you need same SVG file with slight change in it. To do that you can use "states". Just name any SVG group in format like -state-. You can see how states works in SVGButton example class.

This is tested with Adobe Illustrator files. There are some problems with radial gradients. You can see them in exmaple svg file.

Clone this wiki locally