Created
July 4, 2014 07:55
-
-
Save fjolnir/22e579575799574b6616 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMapTable *attributes; | |
for(id path in PSVGPathsFromSVGString(svg, &attributes)) { | |
CAShapeLayer *layer = [CAShapeLayer layer]; | |
layer.path = (__bridge CGPathRef)path; | |
NSDictionary *attrs = [attributes objectForKey:path]; | |
layer.strokeColor = (__bridge CGColorRef)attrs[@"strokeColor"]; | |
layer.lineWidth = [attrs[@"strokeWidth"] floatValue]; | |
layer.fillColor = (__bridge CGColorRef)attrs[@"fillColor"]; | |
[self.view.layer addSublayer:layer]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment