Simple SVG Parser for iOS

September 29, 2013

I’ve added a simple SVG Parser for iOS on github. Get it here: https://github.com/jmenter/JMSVGParser

Here’s how it works:

1.) Call the class method to get back an array of styled shapes

self.shapes = [JMSVGParser parseFileNamed:@"awesome_tiger"]

2.) In your view’s – (void)drawRect:(CGRect)rect method, tell each shape to draw, like this:

for (JMStyledPath *styledPath in self.shapes) {
    [styledPath drawStyledPath];
}

Screen Shot 2013-09-29 at 11.00.06 PM

That’s it! Comments, questions? Leave a note!

Advertisements