Skip to content
This repository was archived by the owner on Aug 3, 2022. It is now read-only.

Commit 3dd4bac

Browse files
committed
Update the readme about the deprecated symbols
1 parent 62736a5 commit 3dd4bac

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
## What's for
1111
SDWebImageSVGKitPlugin is a SVG coder plugin for [SDWebImage](https://github.com/rs/SDWebImage/) framework, which provide the image loading support for [SVG](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics) using [SVGKit](https://github.com/SVGKit/SVGKit) SVG engine.
1212

13+
Note: iOS 13+/macOS 10.15+ supports native SVG rendering (called [Symbol Image](https://developer.apple.com/documentation/uikit/uiimage/configuring_and_displaying_symbol_images_in_your_ui/)), with system framework to load SVG. Check [SDWebImageSVGCoder](https://github.com/SDWebImage/SDWebImageSVGCoder) for more information.
14+
1315
## Example
1416

1517
To run the example project, clone the repo, and run `pod install` from the Example directory first.
@@ -18,9 +20,9 @@ You can modify the code or use some other SVG files to check the compatibility.
1820

1921
## Requirements
2022

21-
+ iOS 8
22-
+ tvOS 9
23-
+ macOS 10.10
23+
+ iOS 8+
24+
+ tvOS 9+
25+
+ macOS 10.10+
2426

2527
## Installation
2628

@@ -53,7 +55,7 @@ github "SDWebImage/SDWebImageSVGKitPlugin"
5355

5456
To use SVG coder, you should firstly add the `SDImageSVGKCoder` to the coders manager. Then you can call the View Category method to start load SVG images.
5557

56-
Because SVG is a [vector image](https://en.wikipedia.org/wiki/Vector_graphics) format, which means it does not have a fixed bitmap size. However, `UIImage` or `CGImage` are all [bitmap image](https://en.wikipedia.org/wiki/Raster_graphics). For `UIImageView`, we will only parse SVG with a fixed image size (from the SVG viewPort information). But we also support you to specify a desired size during image loading using `SDWebImageContextSVGKImageSize` context option. And you can specify whether or not to keep aspect ratio during scale using `SDWebImageContextSVGKImagePreserveAspectRatio` context option.
58+
Because SVG is a [vector image](https://en.wikipedia.org/wiki/Vector_graphics) format, which means it does not have a fixed bitmap size. However, `UIImage` or `CGImage` are all [bitmap image](https://en.wikipedia.org/wiki/Raster_graphics). For `UIImageView`, we will only parse SVG with a fixed image size (from the SVG viewPort information). But we also support you to specify a desired size during image loading using `SDWebImageContextThumbnailPixelSize` context option. And you can specify whether or not to keep aspect ratio during scale using `SDWebImageContextImagePreserveAspectRatio` context option.
5759

5860
+ Objective-C
5961

@@ -63,7 +65,7 @@ SDImageSVGKCoder *svgCoder = [SDImageSVGKCoder sharedCoder];
6365
UIImageView *imageView;
6466
// this arg is optional, if don't provide, use the viewport size instead
6567
CGSize svgImageSize = CGSizeMake(100, 100);
66-
[imageView sd_setImageWithURL:url placeholderImage:nil options:0 context:@{SDWebImageContextSVGKImageSize : @(svgImageSize)];
68+
[imageView sd_setImageWithURL:url placeholderImage:nil options:0 context:@{SDWebImageContextThumbnailPixelSize : @(svgImageSize)];
6769
```
6870
6971
+ Swift
@@ -75,7 +77,7 @@ let imageView: UIImageView
7577
imageView.sd_setImage(with: url)
7678
// this arg is optional, if don't provide, use the viewport size instead
7779
let svgImageSize = CGSize(width: 100, height: 100)
78-
imageView.sd_setImage(with: url, placeholderImage: nil, options: [], context: [.svgkImageSize : svgImageSize])
80+
imageView.sd_setImage(with: url, placeholderImage: nil, options: [], context: [.imageThumbnailPixelSize : svgImageSize])
7981
```
8082

8183
### Use SVGKImageView (render SVG as vector image)
@@ -120,7 +122,7 @@ NSData *imageData = [image sd_imageDataAsFormat:SDImageFormatSVG];
120122
+ Swift
121123
122124
```swift
123-
let image; // Image generated from SDWebImage framework, actually a `SDSVGKImage` instance.
125+
let image: UIImage // Image generated from SDWebImage framework, actually a `SDSVGKImage` instance.
124126
let imageData = image.sd_imageData(as: .SVG)
125127
```
126128

0 commit comments

Comments
 (0)