Skip to content

Commit 8f0fd06

Browse files
committed
Update the readme about CoreSVG private framework notes and current compatibility
1 parent 9de72b8 commit 8f0fd06

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ However, due to the lack support of that third party library, which contains mas
2020

2121
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.
2222

23+
## Note for CoreSVG framework
24+
25+
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 as well to fire radars as well: https://feedbackassistant.apple.com/
26+
27+
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.
28+
29+
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.
30+
31+
If you still worry about the SPI usage, you can use [SDWebImageSVGKitPlugin](https://github.com/SDWebImage/SDWebImageSVGKitPlugin). But we may not response to any parser or rendering issue related to [SVGKit](https://github.com/SVGKit/SVGKit), because it's already no longer maintained.
32+
33+
There is also another solution: [SVG-Native](https://w3c.github.io/svgwg/specs/svg-native/index.html), 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 with the [code from SVG-native-viewer](https://github.com/adobe/svg-native-viewer/blob/master/svgnative/example/testCocoaCG/SVGNSView.mm) and adopt SVG-native for vector images.
34+
2335
## Example
2436

2537
To run the example project, clone the repo, and run `pod install` from the Example directory first.
@@ -154,6 +166,13 @@ if svgImage.sd_isVector { // This API available in SDWebImage 5.6.0
154166
}
155167
```
156168

169+
## Compatibility for CoreSVG framework
170+
171+
1. The CSS `color` does not support hex syntax. Use `rgb` or `rgba` instead
172+
```html
173+
<path d="M399.8,68.2c77.3,3.1,160.6,32.1" fill=rgb(255,255,255) />
174+
```
175+
157176
## Backward Deployment
158177

159178
This framework supports backward deployment on iOS 12-/macOS 10.14-. And you can combine both `SDWebImageSVGCoder` for higher firmware version, use `SDWebImageSVGKitPlugin` for lower firmware version.
@@ -170,7 +189,7 @@ Pay attention, you should always use the runtime version check to ensure those s
170189
if (@available(iOS 13, *)) {
171190
[SDImageCodersManager.sharedCoder addCoder:SDImageSVGCoder.sharedCoder];
172191
} else {
173-
[SDImageCodersManager.sharedCoder addCoder:SDImageSVGKitCoder.sharedCoder];
192+
[SDImageCodersManager.sharedCoder addCoder:SDImageSVGKCoder.sharedCoder];
174193
}
175194
```
176195

0 commit comments

Comments
 (0)