LOTComposition.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // LOTScene.h
  3. // LottieAnimator
  4. //
  5. // Created by Brandon Withrow on 12/14/15.
  6. // Copyright © 2015 Brandon Withrow. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <CoreGraphics/CoreGraphics.h>
  10. @class LOTLayerGroup;
  11. @class LOTLayer;
  12. @class LOTAssetGroup;
  13. @interface LOTComposition : NSObject
  14. /// Load animation by name from the default bundle, Images are also loaded from the bundle
  15. + (nullable instancetype)animationNamed:(nonnull NSString *)animationName NS_SWIFT_NAME(init(name:));
  16. /// Loads animation by name from specified bundle, Images are also loaded from the bundle
  17. + (nullable instancetype)animationNamed:(nonnull NSString *)animationName
  18. inBundle:(nonnull NSBundle *)bundle NS_SWIFT_NAME(init(name:bundle:));
  19. /// Loads an animation from a specific file path. WARNING Do not use a web URL for file path.
  20. + (nullable instancetype)animationWithFilePath:(nonnull NSString *)filePath NS_SWIFT_NAME(init(filePath:));
  21. /// Creates an animation from the deserialized JSON Dictionary
  22. + (nonnull instancetype)animationFromJSON:(nonnull NSDictionary *)animationJSON NS_SWIFT_NAME(init(json:));
  23. /// Creates an animation from the deserialized JSON Dictionary, images are loaded from the specified bundle
  24. + (nonnull instancetype)animationFromJSON:(nullable NSDictionary *)animationJSON
  25. inBundle:(nullable NSBundle *)bundle NS_SWIFT_NAME(init(json:bundle:));
  26. - (instancetype _Nonnull)initWithJSON:(NSDictionary * _Nullable)jsonDictionary
  27. withAssetBundle:(NSBundle * _Nullable)bundle;
  28. @property (nonatomic, readonly) CGRect compBounds;
  29. @property (nonatomic, strong, readonly, nullable) NSNumber *startFrame;
  30. @property (nonatomic, strong, readonly, nullable) NSNumber *endFrame;
  31. @property (nonatomic, strong, readonly, nullable) NSNumber *framerate;
  32. @property (nonatomic, readonly) NSTimeInterval timeDuration;
  33. @property (nonatomic, strong, readonly, nullable) LOTLayerGroup *layerGroup;
  34. @property (nonatomic, strong, readonly, nullable) LOTAssetGroup *assetGroup;
  35. @property (nonatomic, strong, readwrite, nullable) NSString *rootDirectory;
  36. @property (nonatomic, strong, readonly, nullable) NSBundle *assetBundle;
  37. @property (nonatomic, copy, nullable) NSString *cacheKey;
  38. @end