Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error trying to add SVG image to xcode assets

I have converted an image from PNG to SVG using the vectorizer.io website. The SVG image looks fine when viewed with the Chrome browser and in GIMP. But when I try to add it to the asset folder in xcode (Version 11.4.1) I get this error ...

The SVG file provided for the symbol image set X is not suitable. Symbol image file (null) must have a glyph for regular weight Medium image size.

I have tried opening the file with Inkscape and saving it as various versions of the SVG and PDF, but none seem to be acceptable.

I have not been able work out how to provide that glyph, and whether this is a fault in the SVG file or something I have failed to do in xcode.

like image 326
Melchester Avatar asked Apr 29 '20 02:04

Melchester


People also ask

Is SVG supported in Xcode?

Updates from Apple's 2020 WWDC Conference revealed that Xcode 12 will now support the SVG (Scalable Vector Graphics) file format. SVGs are a format of vector graphics known to be smaller files than other vector graphics formats, and as their name implies SVGs scale well.

How do you use SVG images in iOS?

For using SVG, you only need to drag them in your assets folder and then you can use them in your project file by using UIImage class named constructor.

Is PNG a SVG?

Perhaps the most fundamental difference between PNG and SVG is that one is a raster file type and the other is vector. A PNG is a raster — that is, pixel-based — image format. If you scale up a raster image too far, it becomes grainy and pixelated. Similarly, if the image is too small, it can become indistinct.

Does Mac support SVG files?

As mentioned in the beginning, SVG file is widely used to display graphics in Browser, which means it is web browser-friendly and you will be able to open SVG files in Mac browser, like Safari.


Video Answer


1 Answers

Only starting from Xcode 12 you can use SVG.

enter image description here

like image 155
Ramis Avatar answered Oct 01 '22 07:10

Ramis