📈 GH Trending Explorer 🎲 Surprise me

← all repos

SDWebImage / SDWebImageSVGCoder

git clone https://github.com/SDWebImage/SDWebImageSVGCoder.git 1.7.0 · 3y ago 🔥 on GitHub Trending today

A SVG coder plugin for SDWebImage, using Apple's built-in framework

+0
stars, 24h · #587
—
stars, 7 days
—
stars, 30 days
136
★ total
44
forks · 11 open issues

Star history starts 2026-10-20; the chart appears after the second daily snapshot.

LanguageObjective-C
LicenseMIT
Created2018-09-27 (8y ago)
Last push1y ago
Watchers6
OwnerOrganization

Seen on GitHub Trending

  • 2026-10-20 — #17 daily in objective-c

GitHub topics

Links

README excerpt
# SDWebImageSVGCoder
## Background
Currently SDWebImage org provide 3 kinds of SVG Coder Plugin support, here is comparison:
| Plugin Name| Vector Image | Bitmap Image | Platform | Compatibility | Dependency |
|---|---|---|---|---|---|
| SVGNativeCoder | NO | YES | iOS 9+ | Best and W3C standard | adobe/svg-native-viewer |
| SVGCoder | YES | YES | iOS 13+ | OK but buggy on some SVG | Apple CoreSVG(Private) |
| SVGKitPlugin | YES | NO | iOS 9+ | Worst, no longer maintain | SVGKit/SVGKit 
## What's for
SDWebImageSVGCoder is a SVG coder plugin for SDWebImage framework, which provide the image loading support for SVG.
The SVG rendering is done using Apple's framework CoreSVG.framework (introduced in iOS 13/macOS 10.15).
## Note for SVGKit user
Previously before 1.0.0 version, this SVG Coder is powered by third party library SVGKit. Which support iOS 8+(macOS 10.10+) as well.
However, due to the lack support of that third party library, which contains massive issues without community's help, no clarity of version release, makes a pain for us to maintain. So, We decide to deprecate SVGKit support and move it into another repo: SDWebImageSVGKitPlugin.
User who use SVGKit or have to support iOS 8+(macOS 10.10+) can still use that SDWebImageSVGKitPlugin instead. You can also mix these two SVG coders at the same time. But since Apple already provide a built-in framework support, we prefer to use that instead, which can reduce complicated dependency, code size, and get polished from Apple's system upgrade.
## Note for CoreSVG framework
So far (Xcode 11.4 && iOS 13.4), the CoreSVG.framework is still in private framework. I've already send the feedback radar to ask for the public for this framework. If you want, please help us to fire radars and request to Apple as well: https://feedbackassistant.apple.com/
The CoreSVG.framework API is stable and match the same concept as CoreGraphics's PDF API, so it's no reason to keep private. And we've already submitted Apps which use the CoreSVG to render the vector images on App Store.
All the SPI access here we use the runtime access and early check, even if future OS upgrade break the function, this framework will not crash your App and just load failed. I'll keep update to the latest changes for each firmware update.
If you still worry about the SPI usage, you can use SDWebImageSVGKitPlugin. But we may not response to any parser or rendering issue related to SVGKit, because it's already no longer maintained.
There is also another solution: SVG-Native, a new W3C standard from Adobe, which is a subset of SVG/1.1. Both Apple/Google/Microsoft already join the agreement for this standard, you can try to write your own coder using code from SVG-native-viewer and adopt SVG-native for vector images.
> Warning: Some user report that Apple's CoreSVG has compatible issue for some SVGs (like using non-system Font, gradient), from v1.7.0 we protect some cases, but other exceptions are un-catchable. For these crashes, either use `