LOTAnimationTransitionController.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // LOTAnimationTransitionController.h
  3. // Lottie
  4. //
  5. // Created by Brandon Withrow on 1/18/17.
  6. // Copyright © 2017 Brandon Withrow. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <Foundation/Foundation.h>
  10. /** LOTAnimationTransitionController
  11. *
  12. * This class creates a custom UIViewController transition animation
  13. * using a Lottie animation to transition between two view controllers
  14. * The transition can use custom defined layers in After Effects for to/from
  15. *
  16. * When referencing After Effects layers the animator masks or transforms the to/from viewController
  17. * with the referenced layer.
  18. *
  19. */
  20. @interface LOTAnimationTransitionController : NSObject <UIViewControllerAnimatedTransitioning>
  21. /**
  22. The initializer to create a new transition animation.
  23. @param animation The name of the Lottie Animation to load for the transition
  24. @param fromLayer The name of the custom layer to mask the fromVC screenshot with.
  25. If no layer is specified then the screenshot is added behind the Lottie Animation
  26. @param toLayer The name of the custom layer to mask the toVC screenshot with.
  27. If no layer is specified then the screenshot is added behind the Lottie Animation
  28. and a fade transition is performed along with the Lottie animation.
  29. @param applyAnimationTransform A boolean that determines if the custom layer should
  30. have the transform animation from the After Effects layer applied to it. If NO the
  31. layer will be masked by the After Effects Layer
  32. */
  33. - (nonnull instancetype)initWithAnimationNamed:(nonnull NSString *)animation
  34. fromLayerNamed:(nullable NSString *)fromLayer
  35. toLayerNamed:(nullable NSString *)toLayer
  36. applyAnimationTransform:(BOOL)applyAnimationTransform;
  37. /**
  38. The initializer to create a new transition animation.
  39. @param animation The name of the Lottie Animation to load for the transition
  40. @param fromLayer The name of the custom layer to mask the fromVC screenshot with.
  41. If no layer is specified then the screenshot is added behind the Lottie Animation
  42. @param toLayer The name of the custom layer to mask the toVC screenshot with.
  43. If no layer is specified then the screenshot is added behind the Lottie Animation
  44. and a fade transition is performed along with the Lottie animation.
  45. @param applyAnimationTransform A boolean that determines if the custom layer should
  46. have the transform animation from the After Effects layer applied to it. If NO the
  47. layer will be masked by the After Effects Layer
  48. @param bundle custom bundle to load animation and images, if no bundle is specified will load
  49. from mainBundle
  50. */
  51. - (instancetype _Nonnull)initWithAnimationNamed:(NSString *_Nonnull)animation
  52. fromLayerNamed:(NSString *_Nullable)fromLayer
  53. toLayerNamed:(NSString *_Nullable)toLayer
  54. applyAnimationTransform:(BOOL)applyAnimationTransform
  55. inBundle:(NSBundle *_Nonnull)bundle;
  56. @end