1
我從服務器獲取.svg網址。如何從.svg url轉換NSData並將其轉換爲UIImage。我越來越喜歡的網址「https://storage.googleapis.com/pgcdn/ca/svg/lock.svg」,我使用此代碼.svg url to UIImage iOS
NSURL *url = [NSURL URLWithString:urlString];
dispatch_queue_t callerQueue = dispatch_get_main_queue();
dispatch_queue_t downloadQueue = dispatch_queue_create("com.test.svg", NULL);
dispatch_async(downloadQueue, ^{
NSData *imageData = [NSData dataWithContentsOfURL:url];
UIImage *image = [UIImage imageWithData:imageData];
});
此功能使圖像的零值。
plz使用此鏈接:https://github.com/SVGKit/SVGKit –