SDFLAnimatedImage

@interface SDFLAnimatedImage : UIImage <SDAnimatedImage>

A wrapper class to allow FLAnimatedImage to be compatible for SDWebImage loading/cache/rendering system. The GIF image loading from FLAnimatedImageView+WebCache category, will use this subclass instead of UIImage.

Note

Though this class conforms to SDAnimatedImage protocol, so it’s compatible to be used for SDAnimatedImageView. But it’s normally discouraged to do so. Because it does not provide optimization for animation rendering. Instead, use SDAnimatedImage class with SDAnimatedImageView.
  • The FLAnimatedImage instance for GIF representation. This property typically be nonnull if you init the image with the following methods. However, it will be null when you call super method like initWithCGImage:

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) FLAnimatedImage *animatedImage;

    Swift

    var animatedImage: FLAnimatedImage? { get }
  • Create the wrapper with specify FLAnimatedImage instance. The instance should be nonnull. This is a convenience method for some use cases, for example, create a placeholder with FLAnimatedImage.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnimatedImage:
        (nonnull FLAnimatedImage *)animatedImage;

    Swift

    init(animatedImage: FLAnimatedImage)

    Parameters

    animatedImage

    The FLAnimatedImage instance

    Return Value

    An initialized object

  • Declaration

    Objective-C

    + (nullable instancetype)imageWithContentsOfFile:(nonnull NSString *)path;
  • Declaration

    Objective-C

    + (nullable instancetype)imageWithData:(nonnull NSData *)data;
  • Declaration

    Objective-C

    + (nullable instancetype)imageWithData:(nonnull NSData *)data scale:(CGFloat)scale;
  • Declaration

    Objective-C

    - (nullable instancetype)initWithContentsOfFile:(nonnull NSString *)path;

    Swift

    init?(contentsOfFile path: String)
  • Declaration

    Objective-C

    - (nullable instancetype)initWithData:(nonnull NSData *)data;

    Swift

    init?(data: Data)
  • Declaration

    Objective-C

    - (nullable instancetype)initWithData:(nonnull NSData *)data scale:(CGFloat)scale;

    Swift

    init?(data: Data, scale: CGFloat)