SVGKit. NSString to SVGKImage?

704 Views Asked by At

SVGKImage has imageWithData: method which is not implemented.

I also know that I can store NSString object as file and load it to a library via another method. But it would be too slow for me. Are there any other solutions?

1

There are 1 best solutions below

0
On BEST ANSWER

The solution is very strange. They didn't implement imageWithData:, but they almost implemented imageWithString:

#import "SVGKit.h"
#import "SVGKSourceString.h"

NSString *svgStr = ...;
SVGKImage *image = [SVGKImage imageWithSource:[SVGKSourceString sourceFromContentsOfString:svgStr]];