You found the perfect vector icons and lived happily ever after… until you run headlong into Xcode. Xcode 7 doesn’t have full vector support for iOS, which can make your icons look something like this:
Instead of scaling vectors at run time, the Xcode system takes your PDF image and generates @1x PNG, @2x PNG, and @3x PNG assets at build time.
Say you have a home.pdf that is a 100x100px vector asset. When you build your project, Xcode creates the following files from it:
When you run the app, iOS automatically picks the size of the icon depending on the device.
There are a few possible reasons for Apple to make it work like this:
You can use Adobe Illustrator or any other vector editing tool.
Remember that you cannot choose a new size for the image. Stick with the size you’ve specified, or create a new PDF for a larger size.
Any doubts about the icon sizes? Check out our guide.
If you don’t have an Images.xcassets file, you’ll have to create it first. From there, choose New Image Set from the Editor menu.
If you use Xcode 6.3 or newer, select the Attributes Inspector and pick Single Vector in the Scale Factors. In older versions you should set Types to Vectors.
The drop point All, Universal will automatically appear in the Image Set.
For example: [UIImage imageNamed:@”Home”]
Thank you, dear Senseful, for your competent answer on Stack Overflow. It became the foundation for this article.
Icons8 iOS developer Pavel prepared a rewrite. Pavel is also a CTO at ZipZapMac – a Mac software development company. He knows the solutions to a variety of problems: from working around bugs of OS X components to avoiding a ban in App Store.
Our editor Josh and a content strategist Uliana helped us to make this text even more readable.
No matter if you’re a developer or a designer – usability studies benefit one. And they can be fun as well – check out Don’t Listen to Users and 4 Other Myths About Usability Testing
Bonus: how to increase your productivity [written by our lead developer] : Productivity Tools: When the Faintest Ink Is More Powerful Than the Strongest Memory
Robots doing all your work sounds perfect—until they’re stuck in loops, grabbing random tweets, and…
Most emails are forgettable. Great ones hook you fast, look sharp, and drive clicks. Here’s…
We put top AI face swappers to the test—beards, glasses, head tilts, and more. Some…
Learn more about each step within the design process to improve your UX workflow.
A deep dive into the smallest images in graphic design: the history of icons, their…
Learn how to use visual hierarchy to guide attention, prioritize elements, and create designs that…
This website uses cookies.