UIImage(GIF)

@interface UIImage (GIF)

This category is just use as a convenience method. For more detail control, use methods in UIImage+MultiFormat.h or directly use SDImageCoder.

  • Creates an animated UIImage from an NSData. This will create animated image if the data is Animated GIF. And will create a static image is the data is Static GIF.

    Declaration

    Objective-C

    + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data;

    Swift

    class func sd_image(withGIFData data: Data?) -> UIImage?

    Parameters

    data

    The GIF data

    Return Value

    The created image