SVGAPlayer.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // SVGAPlayer.h
  3. // SVGAPlayer
  4. //
  5. // Created by 崔明辉 on 16/6/17.
  6. // Copyright © 2016年 UED Center. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class SVGAVideoEntity, SVGAPlayer;
  10. @protocol SVGAPlayerDelegate <NSObject>
  11. @optional
  12. - (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player;
  13. - (void)svgaPlayerDidAnimatedToFrame:(NSInteger)frame;
  14. - (void)svgaPlayerDidAnimatedToPercentage:(CGFloat)percentage;
  15. @end
  16. @interface SVGAPlayer : UIView
  17. @property (nonatomic, weak) id<SVGAPlayerDelegate> delegate;
  18. @property (nonatomic, strong) SVGAVideoEntity *videoItem;
  19. @property (nonatomic, assign) IBInspectable int loops;
  20. @property (nonatomic, assign) IBInspectable BOOL clearsAfterStop;
  21. @property (nonatomic, copy) NSString *fillMode;
  22. - (void)startAnimation;
  23. - (void)pauseAnimation;
  24. - (void)stopAnimation;
  25. - (void)clear;
  26. - (void)stepToFrame:(NSInteger)frame andPlay:(BOOL)andPlay;
  27. - (void)stepToPercentage:(CGFloat)percentage andPlay:(BOOL)andPlay;
  28. #pragma mark - Dynamic Object
  29. - (void)setImage:(UIImage *)image forKey:(NSString *)aKey;
  30. - (void)setImageWithURL:(NSURL *)URL forKey:(NSString *)aKey;
  31. - (void)setImage:(UIImage *)image forKey:(NSString *)aKey referenceLayer:(CALayer *)referenceLayer; // deprecated from 2.0.1
  32. - (void)setAttributedText:(NSAttributedString *)attributedText forKey:(NSString *)aKey;
  33. - (void)clearDynamicObjects;
  34. @end