Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

w3goodies

macrumors newbie
Original poster
Dec 25, 2017
1
0
Hello there,
Last year when I was making an app for my company, I was having trouble trying to import SVG directly into XCode. Maybe this is not the case now. So at that time, I made a small script that converts SVG into iOS Images Package in PNG's and I used that in my project.

For all the fellow iOS developers, I published the script here:
https://w3goodies.com/export-images/svg-to-ios.html

It simply works like this:
  1. You upload your SVG.
  2. You provide the base size. Which becomes the "normal" version of your SVG. Let's suppose you provided 32px.
  3. The page will then give you back single zip file containing these files:
File => Image size
  1. your_file.png => 32px (base)
  2. your_file@2x.png => 64px
  3. your_file@3x.png => 96px
The script makes the resolution of image very high before converting so the quality of exported images will be very good.
Normally, you could simply drag the contents of zip file into your XCode's "images.xcassets" folder.

I hope this tool makes the work of my fellow iOS Developers some easy. Happy coding!

--------

If you also code for Android I posted similar post on AndroidDev sub reddit: https://www.reddit.com/r/androiddev/comments/6mbuba/svg_to_android_drawables_package_in_png/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.