9

I drag pdf intro image assets (universal) and building Xcode.

There is no generated png@2 png@3 . (only Pdf)

I follow this tutorial : https://icons8.com/articles/how-to-use-vectors-in-xcode-7/

When I start app on the device images are so bad quality...

enter image description here

Xcode 6, 7 working .... Maybe PDF file needs optimisation ?!

In research I found "size of svg is not important" but in this case it is (I test it).

pkamb
  • 33,281
  • 23
  • 160
  • 191
Nikola Lukic
  • 4,001
  • 6
  • 44
  • 75

2 Answers2

2

Not sure if this helps, but from what I was reading about this, Xcode doesn't fully support vector graphics. It sounds like instead of you being able to load a vector image (.pdf) and it scales however necessary. Instead, whatever the default size of your .pdf is, it'll assume that is the 1x size, then scale the pdf to automatically create the 2x and 3x image when it's built. So its not actually scaling the original, just creating a 1x, 2x, and 3x png of the original size of your pdf. From what I'm reading, people are thinking this is done to maintain backwards compatibility. I couldn't find anything that says it has changed in Xcode 8, so I'm assuming it still works the same way.

This question seems to answer it well: How do vector images work in Xcode (i.e. pdf files)?

Hope I was able to help.

Community
  • 1
  • 1
Jason Brady
  • 1,560
  • 1
  • 17
  • 40
  • Tell me about png . Xcode create file (on hard-disk) or just he just create image data in runtime virtual (on start up) ? – Nikola Lukic Oct 25 '16 at 12:47
  • 1
    Correct, it just creates the png on runtime. I just started converting all my images to pdf and they have been working great. Everything is sized the way I'd expect it to be. Keeping in mind, that your original pdf needs to be sized to fit the 1x resolution. – Jason Brady Oct 25 '16 at 15:35
  • Just a correction. The .png's are built from PDF at compile time not run time. You take a small hit at build time, but it should be minimal. Depends on number of PDF's that need to be converted. – xdeleon Jul 12 '17 at 14:50
0

Possible hepful support links, I would suggest updating to the latest. xcode 13 xcode 8.1 xcode 8

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30369227) – Michael Bruesch Nov 23 '21 at 16:12