From 1b22ee5e56360088d9650a942c23c7917c0b75b9 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sat, 18 Jan 2020 19:17:08 +0800 Subject: [PATCH] Update the readme about the progressive animation decoding --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b510e3d..3d2e3fd 100644 --- a/README.md +++ b/README.md @@ -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