- Notifications
You must be signed in to change notification settings - Fork18
A SDWebImage plugin to support GIF using FLAnimatedImage and category
License
SDWebImage/SDWebImageFLPlugin
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Starting with the SDWebImage 5.0 version, we move theFLAnimatedImage support code from the Core Repo to this stand-alone repo.
Code which previously use FLAnimatedImage with SDWebImage can continue to work with this plugin. But it's recommended to use the5.0 Animated Image Solution to get better support and more features.
SDWebImageFLPlugin is a plugin forSDWebImage framework, which provide the image loading support forFLAnimatedImage animated GIF engine.
By using SDWebImageFLPlugin, you can use all you familiar SDWebImage's loading method, on theFLAnimatedImageView, which is the base component of FLAnimatedImage.
To use it, simply make sure you useFLAnimatedImageView instead ofUIImageView and import this plugin.
To load images from network, just simply call the View Category method like normal UIImageView.
- Objective-C
FLAnimatedImageView *imageView;[imageViewsd_setImageWithURL:[NSURLURLWithString:@"http://www.domain.com/path/to/image.gif"]];
- Swift
letimageView:FLAnimatedImageViewimageView.sd_setImage(with:URL(string:"http://www.domain.com/path/to/image.gif"))
The magic because we create one custom animation class calledSDFLAnimatedImage to load GIF images, and useUIImage for normal images.
For placeholder, you can even provide aFLAnimatedImage to allow GIF placeholder onFLAnimatedImageView using the wrapper classSDFLAnimatedImage.
- Objective-C
FLAnimatedImageView *imageView;FLAnimatedImage *animatedImage = [FLAnimatedImageanimatedImageWithGIFData:gifData];SDFLAnimatedImage *placeholder = [[SDFLAnimatedImagealloc]initWithAnimatedImage:animatedImage];[imageViewsd_setImageWithURL:[NSURLURLWithString:@"http://www.domain.com/path/to/image.gif"]placeholderImage:placeholder];
- Swift
letimageView:FLAnimatedImageViewletanimatedImage=FLAnimatedImage(animatedGIFData: gifData)letplaceholder=SDFLAnimatedImage(animatedImage: animatedImage)imageView.sd_setImage(with:URL(string:"http://www.domain.com/path/to/image.gif"), placeholderImage: placeholder)
- iOS 9+
- Xcode 11+
SDWebImageFLPlugin is available throughCocoaPods. To installit, simply add the following line to your Podfile:
pod'SDWebImageFLPlugin'
SDWebImageFLPlugin is available throughCarthage.
github "SDWebImage/SDWebImageFLPlugin"SDWebImageFLPlugin is available throughSwift Package Manager.
letpackage=Package( dependencies:[.package(url:"https://github.com/SDWebImage/SDWebImageFLPlugin.git", from:"0.6.0")])
DreamPiggy,lizhuoli1126@126.com
SDWebImageFLPlugin is available under the MIT license. See the LICENSE file for more info.
About
A SDWebImage plugin to support GIF using FLAnimatedImage and category
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors3
Uh oh!
There was an error while loading.Please reload this page.