Native SVG support

I work part time with web development and part time developing mac graphics design apps and the occasional iOS project, and with my own focus on vector graphics and both retina interfaces and web graphics I've been working more and more with SVG format graphics.


It has become more and more frustrating that there is no native support for rendering or parsing SVG files in macOS/iOS. Both from a personal point of view as it would make developing my vector graphics apps and supporting SVG import/export for easier. And from a more general point of view as it seems the SVG format would be such a good fit for making resolution-independent interface graphics (like it's already used on web and android) for everyone. Especially when compared to the convoluted and propriterty adobe pdf format currently offered as the vector format option.


So, with the hope that someone here might be able to answer:

Are there currently any plans to add native support for SVG format vector images in macOS/iOS? And with that I mean letting us draw/parse/generate them in Core Graphics, use them for NSImage/UIImage, etc etc. It seems long overdue and such a missed opportunity.

Whlie I can't comment on what Apple may or may not be doing; there is, what I'd consider a dirty workaround.


1. Load a SVG file into a WKWebView.

2. Use [NSView dataWithPDFInsideRect:] to get a NSData object.

3. Use [NSImage initWithData:] to get a NSImage with the PDF data.

SVG files have been added as of Xcode 12.

From Apple's Xcode 12 release notes:

Asset Catalogs
New Features

Added support for Scalable Vector Graphic (SVG) image assets. These preserve their vector representation with deployment targets of macOS 10.15 or later, iOS 13 or later, and iPadOS 13 or later. (18389814)
Sharp eyes have noticed that there is a private CoreSVG in the latest iOS Beta. Apparently it is used for SVG support within Webkit, as well as possibly for the new SVG support for app artwork. It would be great if Apple exported that for developers.

It is 2024, Still there is no way to load SVG images from URL in SwiftUI. SVG is now getting used more and more in applications and no official support is announced for this.

Native SVG support
 
 
Q