-
Notifications
You must be signed in to change notification settings - Fork 9
About
Main target of that project - render simple SVG files at iOS devices.
How it works:
-
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.
-
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).
-
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.