Update the readme about the progressive animation decoding

This commit is contained in:
DreamPiggy 2020-01-18 19:17:08 +08:00
parent e4af4b805e
commit 1b22ee5e56
1 changed files with 25 additions and 3 deletions

View File

@ -91,9 +91,9 @@ SDWebImageDownloader.shared.setValue("image/webp,image/*,*/*;q=0.8", forHTTPHead
+ Objective-C
```objective-c
// WebP image loading
UIImageView *imageView;
// WebP online image loading
NSURL *webpURL;
UIImageView *imageView;
[imageView sd_setImageWithURL:webpURL];
```
@ -106,6 +106,28 @@ let imageView: UIImageView
imageView.sd_setImage(with: webpURL)
```
### Progressive Animation Loading (0.5.0+)
+ Objective-C
```objective-c
// WebP progressive loading for animated image
NSURL *webpURL;
SDAnimatedImageView *imageView;
imageView.shouldIncrementalLoad = YES;
[imageView sd_setImageWithURL:webpURL placeholderImage:nil options:SDWebImageProgressiveLoad];
```
+ Swift
```swift
// WebP progressive loading for animated image
let webpURL: URL
let imageView: SDAnimatedImageView
imageView.shouldIncrementalLoad = true
imageView.sd_setImage(with: webpURL, placeholderImage: nil, options: [.progressiveLoad])
```
### Decoding
+ Objective-C
@ -124,7 +146,7 @@ let webpData: Data
let image = SDImageWebPCoder.shared.decodedImage(with: data, options: nil)
```
### Thumbnail Decoding
### Thumbnail Decoding (0.4.0+)
+ Objective-C