Good Day. I am making an extension for mac. The RestAPI i am using is providing image url that has .svg format images. I tried loading .svg images but nothing appears. I know mac supports png images and there is a tedious way to render .svg image on mac. Is there any way i can convert .svg to .png upon download using swift?
Asked
Active
Viewed 5,320 times
3
-
I see perfectly no reason why the question is being down voted. I always search around on the web and if the search is in vain i try to seek help among the best developers there are. How to convert a downloaded svg image to png on an extension after being downloaded on mac was what i was pondering. – Ali Abbas Jaffri May 10 '15 at 20:39
-
I didn't down vote but I know why others down voted. You question title is about "how to display .svg" while you question body is about "how to convert .svg to .png". – Tyler Liu Sep 25 '15 at 07:51
-
1Below is a great tutorial on how to get vector images into Xcode. You have to use the PDF format. https://www.createful.com/2014/using-vector-pdf-icons-xcode-6/ – nick9999 May 10 '15 at 21:20
1 Answers
1
As far as I know there's no OSX or iOS native support for SVG files. A quick search of GitHub using the search string "Mac SVG" found several libraries that will display SVG files. I suggest you use one of those.

Duncan C
- 128,072
- 22
- 173
- 272
-
I have checked out all of those and all of them are built on ObjectiveC. There is some issue with XCode that just won't let me compile even one additional class when building an extension. That is the very reason i asked the question in the first place and my reluctance in using ObjectiveC libraries. – Ali Abbas Jaffri May 10 '15 at 20:52
-
Objective-C and Swift inter-operate just fine. It sounds like that's what you need help with - figuring out how to import and use Objective-C classes from Swift. You might want to post a new question about that, and mention the specific library in the subject. Based on the 10 second search I did, jacekmigacz/ObjectiveSVG looked like the best bet. – Duncan C May 10 '15 at 20:54