Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 3, 2022. It is now read-only.

A SDWebImage plugin to support GIF using FLAnimatedImage and category

License

NotificationsYou must be signed in to change notification settings

SDWebImage/SDWebImageFLPlugin

Repository files navigation

CI StatusVersionLicensePlatformSwiftPM compatibleCarthage compatiblecodecov

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.

What's for

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.

Usage

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)

Requirements

  • iOS 9+
  • Xcode 11+

Installation

CocoaPods

SDWebImageFLPlugin is available throughCocoaPods. To installit, simply add the following line to your Podfile:

pod'SDWebImageFLPlugin'

Carthage

SDWebImageFLPlugin is available throughCarthage.

github "SDWebImage/SDWebImageFLPlugin"

Swift Package Manager (Xcode 11+)

SDWebImageFLPlugin is available throughSwift Package Manager.

letpackage=Package(    dependencies:[.package(url:"https://github.com/SDWebImage/SDWebImageFLPlugin.git", from:"0.6.0")])

Author

DreamPiggy,lizhuoli1126@126.com

License

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

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp