SDImageFrame.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. #import <Foundation/Foundation.h>
  9. #import "SDWebImageCompat.h"
  10. /**
  11. This class is used for creating animated images via `animatedImageWithFrames` in `SDImageCoderHelper`.
  12. @note If you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+Metadata.h`.
  13. */
  14. @interface SDImageFrame : NSObject
  15. /**
  16. The image of current frame. You should not set an animated image.
  17. */
  18. @property (nonatomic, strong, readonly, nonnull) UIImage *image;
  19. /**
  20. The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero.
  21. */
  22. @property (nonatomic, readonly, assign) NSTimeInterval duration;
  23. /**
  24. Create a frame instance with specify image and duration
  25. @param image current frame's image
  26. @param duration current frame's duration
  27. @return frame instance
  28. */
  29. + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration;
  30. @end