SDImageFrame

@interface SDImageFrame : NSObject

This class is used for creating animated images via animatedImageWithFrames in SDImageCoderHelper.

Note

If you need to specify animated images loop count, use sd_imageLoopCount property in UIImage+Metadata.h.
  • The image of current frame. You should not set an animated image.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull) UIImage *image;

    Swift

    var image: UIImage { get }
  • The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSTimeInterval duration;

    Swift

    var duration: TimeInterval { get }
  • Create a frame instance with specify image and duration

    Declaration

    Objective-C

    + (instancetype _Nonnull)frameWithImage:(UIImage *_Nonnull)image
                                   duration:(NSTimeInterval)duration;

    Swift

    convenience init(image: UIImage, duration: TimeInterval)

    Parameters

    image

    current frame’s image

    duration

    current frame’s duration

    Return Value

    frame instance