-
Notifications
You must be signed in to change notification settings - Fork 98
FAQ
- I don't want animated GIF support, how do I disable it?
- I don't want automatic animated GIF playback on a specific view, how do I disable it?
- I use
-requestImageForResource:...
method to request a GIF, how do I display it?
Animated GIF support in DFImageManager
is implemented as a subspec, which is installed by default. Modify your Podfile to include only Core
subspec:
pod 'DFImageManager/Core'
The DFImageManager
automatically starts GIF playback on DFImageView
. To disable automatic playback use a allowsGIFPlayback
property:
DFImageView *imageView = ...;
imageView.allowsGIFPlayback = NO;
The DFImageManager
will give you an instance of DFAnimatedImage : UIImage
class for an image when request is complete. The DFAnimatedImage
object represents a poster image for the underlying animated image. It is a regular UIImage
that doesn't override any of the native UIImage
behaviors and it can be used anywhere where a regular UIImage
can be used.
The underlying animated image is an instance ofFLAnimatedImage : NSObject
class that can be used for GIF playback in the FLAnimatedImageView : UIImageView
object. To start playback set the animatedImage
property of FLAnimatedImageView
. For more info on FLAnimatedImage
see FLAnimatedImage library.
The DFImageView
class is a subclass of FLAnimatedImageView
(only when GIF
subspec is installed) and can also be used for GIF playback. The DFImageView
doesn't override any of the FLAnimatedImageView
methods so should get the same experience as when using the FLAnimatedImageView
class directly. The only addition is a new - (void)displayImage:(UIImage *)image
method that supports DFAnimatedImage
objects and will automatically start GIF playback when passed an object of that class.