iosimagensstringnsdatasvgkit

SVGKit. NSString to SVGKImage?


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?


Solution

  • 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]];