├── lottie.gif ├── Pods ├── Headers │ ├── Private │ │ └── lottie-ios │ │ │ └── Lottie │ │ │ ├── LOTAsset.h │ │ │ ├── LOTLayer.h │ │ │ ├── LOTMask.h │ │ │ ├── LOTModels.h │ │ │ ├── Lottie.h │ │ │ ├── LOTAssetGroup.h │ │ │ ├── LOTHelpers.h │ │ │ ├── LOTLayerGroup.h │ │ │ ├── LOTShapeFill.h │ │ │ ├── LOTShapeGroup.h │ │ │ ├── LOTShapePath.h │ │ │ ├── LOTShapeStar.h │ │ │ ├── UIColor.h │ │ │ ├── LOTBezierPath.h │ │ │ ├── LOTShapeCircle.h │ │ │ ├── LOTShapeStroke.h │ │ │ ├── LOTAnimatorNode.h │ │ │ ├── LOTComposition.h │ │ │ ├── LOTKeyframe.h │ │ │ ├── LOTRenderNode.h │ │ │ ├── LOTShapeRectangle.h │ │ │ ├── LOTShapeRepeater.h │ │ │ ├── LOTShapeTransform.h │ │ │ ├── LOTShapeTrimPath.h │ │ │ ├── UIColor+Expanded.h │ │ │ ├── CALayer+Compat.h │ │ │ ├── LOTAnimationCache.h │ │ │ ├── LOTAnimationView.h │ │ │ ├── LOTBezierData.h │ │ │ ├── LOTCacheProvider.h │ │ │ ├── LOTShapeGradientFill.h │ │ │ ├── NSValue+Compat.h │ │ │ ├── LOTLayerContainer.h │ │ │ ├── LOTMaskContainer.h │ │ │ ├── LOTPlatformCompat.h │ │ │ ├── LOTRenderGroup.h │ │ │ ├── CGGeometry+LOTAdditions.h │ │ │ ├── LOTAnimationView_Internal.h │ │ │ ├── LOTFillRenderer.h │ │ │ ├── LOTPathAnimator.h │ │ │ ├── LOTRadialGradientLayer.h │ │ │ ├── LOTAnimationView_Compat.h │ │ │ ├── LOTCircleAnimator.h │ │ │ ├── LOTCompositionContainer.h │ │ │ ├── LOTPolygonAnimator.h │ │ │ ├── LOTRepeaterRenderer.h │ │ │ ├── LOTStrokeRenderer.h │ │ │ ├── LOTTrimPathNode.h │ │ │ ├── LOTGradientFillRender.h │ │ │ ├── LOTPolystarAnimator.h │ │ │ ├── LOTArrayInterpolator.h │ │ │ ├── LOTColorInterpolator.h │ │ │ ├── LOTNumberInterpolator.h │ │ │ ├── LOTPathInterpolator.h │ │ │ ├── LOTPointInterpolator.h │ │ │ ├── LOTRoundedRectAnimator.h │ │ │ ├── LOTSizeInterpolator.h │ │ │ ├── LOTValueInterpolator.h │ │ │ ├── LOTAnimationTransitionController.h │ │ │ └── LOTTransformInterpolator.h │ └── Public │ │ └── lottie-ios │ │ └── Lottie │ │ ├── Lottie.h │ │ ├── LOTComposition.h │ │ ├── LOTAnimationCache.h │ │ ├── LOTAnimationView.h │ │ ├── LOTCacheProvider.h │ │ ├── LOTAnimationView_Compat.h │ │ └── LOTAnimationTransitionController.h ├── Target Support Files │ ├── lottie-ios │ │ ├── lottie-ios-dummy.m │ │ ├── lottie-ios-prefix.pch │ │ └── lottie-ios.xcconfig │ └── Pods-DYLottieDemo │ │ ├── Pods-DYLottieDemo-dummy.m │ │ ├── Pods-DYLottieDemo.debug.xcconfig │ │ ├── Pods-DYLottieDemo.release.xcconfig │ │ └── Pods-DYLottieDemo-frameworks.sh ├── Manifest.lock ├── lottie-ios │ └── lottie-ios │ │ └── Classes │ │ ├── RenderSystem │ │ ├── LOTRenderNode.h │ │ ├── InterpolatorNodes │ │ │ ├── LOTSizeInterpolator.h │ │ │ ├── LOTPointInterpolator.h │ │ │ ├── LOTArrayInterpolator.h │ │ │ ├── LOTColorInterpolator.h │ │ │ ├── LOTNumberInterpolator.h │ │ │ ├── LOTPathInterpolator.h │ │ │ ├── LOTValueInterpolator.h │ │ │ ├── LOTNumberInterpolator.m │ │ │ ├── LOTArrayInterpolator.m │ │ │ ├── LOTColorInterpolator.m │ │ │ ├── LOTSizeInterpolator.m │ │ │ ├── LOTPointInterpolator.m │ │ │ ├── LOTTransformInterpolator.h │ │ │ └── LOTPathInterpolator.m │ │ ├── AnimatorNodes │ │ │ ├── LOTPathAnimator.h │ │ │ ├── LOTPolygonAnimator.h │ │ │ ├── LOTPolystarAnimator.h │ │ │ ├── LOTCircleAnimator.h │ │ │ ├── LOTRoundedRectAnimator.h │ │ │ ├── LOTPathAnimator.m │ │ │ ├── LOTCircleAnimator.m │ │ │ └── LOTPolygonAnimator.m │ │ ├── RenderNodes │ │ │ ├── LOTFillRenderer.h │ │ │ ├── LOTStrokeRenderer.h │ │ │ ├── LOTRepeaterRenderer.h │ │ │ ├── LOTGradientFillRender.h │ │ │ ├── LOTRenderGroup.h │ │ │ ├── LOTFillRenderer.m │ │ │ ├── LOTStrokeRenderer.m │ │ │ └── LOTRepeaterRenderer.m │ │ ├── ManipulatorNodes │ │ │ ├── LOTTrimPathNode.h │ │ │ └── LOTTrimPathNode.m │ │ ├── LOTRenderNode.m │ │ ├── LOTAnimatorNode.h │ │ └── LOTAnimatorNode.m │ │ ├── MacCompatability │ │ ├── CALayer+Compat.h │ │ ├── CALayer+Compat.m │ │ ├── NSValue+Compat.h │ │ ├── NSValue+Compat.m │ │ ├── LOTPlatformCompat.h │ │ ├── UIColor.h │ │ └── UIColor.m │ │ ├── Private │ │ ├── LOTCacheProvider.m │ │ ├── LOTAnimationView_Internal.h │ │ ├── LOTAnimationCache.m │ │ ├── LOTComposition.m │ │ └── LOTAnimationTransitionController.m │ │ ├── AnimatableLayers │ │ ├── LOTMaskContainer.h │ │ ├── LOTCompositionContainer.h │ │ ├── LOTLayerContainer.h │ │ └── LOTMaskContainer.m │ │ ├── Extensions │ │ ├── LOTHelpers.h │ │ ├── LOTRadialGradientLayer.h │ │ ├── LOTBezierPath.h │ │ ├── UIColor+Expanded.h │ │ ├── LOTRadialGradientLayer.m │ │ └── CGGeometry+LOTAdditions.h │ │ ├── Models │ │ ├── LOTShapePath.h │ │ ├── LOTShapeGroup.h │ │ ├── LOTShapeTrimPath.h │ │ ├── LOTShapeCircle.h │ │ ├── LOTShapeRectangle.h │ │ ├── LOTLayerGroup.h │ │ ├── LOTModels.h │ │ ├── LOTShapeFill.h │ │ ├── LOTAssetGroup.h │ │ ├── LOTShapeTransform.h │ │ ├── LOTShapePath.m │ │ ├── LOTMask.h │ │ ├── LOTShapeCircle.m │ │ ├── LOTShapeGradientFill.h │ │ ├── LOTShapeRepeater.h │ │ ├── LOTShapeTrimPath.m │ │ ├── LOTShapeStar.h │ │ ├── LOTAsset.h │ │ ├── LOTShapeStroke.h │ │ ├── LOTShapeRectangle.m │ │ ├── LOTShapeFill.m │ │ ├── LOTAsset.m │ │ ├── LOTLayerGroup.m │ │ ├── LOTMask.m │ │ ├── LOTShapeGradientFill.m │ │ ├── LOTShapeStar.m │ │ ├── LOTAssetGroup.m │ │ ├── LOTShapeStroke.m │ │ ├── LOTLayer.h │ │ ├── LOTShapeRepeater.m │ │ ├── LOTShapeTransform.m │ │ └── LOTShapeGroup.m │ │ ├── AnimatableProperties │ │ ├── LOTBezierData.h │ │ ├── LOTKeyframe.h │ │ └── LOTBezierData.m │ │ └── PublicHeaders │ │ ├── LOTAnimationCache.h │ │ ├── LOTCacheProvider.h │ │ ├── Lottie.h │ │ ├── LOTAnimationView_Compat.h │ │ ├── LOTComposition.h │ │ └── LOTAnimationTransitionController.h └── Pods.xcodeproj │ └── xcuserdata │ └── yaolongkang.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ ├── lottie-ios.xcscheme │ └── Pods-DYLottieDemo.xcscheme ├── podfile ├── DYLottieDemo.xcworkspace ├── xcuserdata │ └── yaolongkang.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── UserInterfaceState.xcuserstate └── contents.xcworkspacedata ├── README.md ├── DYLottieDemo.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── yaolongkang.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── yaolongkang.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ └── DYLottieDemo.xcscheme ├── Podfile.lock ├── DYLottieDemo ├── ViewController.h ├── AppDelegate.h ├── main.m ├── DYAnimationVC.h ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── ViewController.m └── AppDelegate.m ├── DYLottieDemoTests ├── Info.plist └── DYLottieDemoTests.m ├── DYLottieDemoUITests ├── Info.plist └── DYLottieDemoUITests.m ├── LICENSE └── .gitignore /lottie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/DYLottieDemo/HEAD/lottie.gif -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAsset.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTAsset.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTLayer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTLayer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTMask.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTMask.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTModels.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTModels.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/Lottie.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/Lottie.h -------------------------------------------------------------------------------- /Pods/Headers/Public/lottie-ios/Lottie/Lottie.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/Lottie.h -------------------------------------------------------------------------------- /podfile: -------------------------------------------------------------------------------- 1 | platform :ios, ‘8.0’ 2 | inhibit_all_warnings! 3 | target ‘DYLottieDemo’ do 4 | pod 'lottie-ios' 5 | end -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAssetGroup.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTAssetGroup.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTHelpers.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Extensions/LOTHelpers.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTLayerGroup.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTLayerGroup.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeFill.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeFill.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeGroup.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeGroup.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapePath.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapePath.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeStar.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeStar.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/UIColor.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/MacCompatability/UIColor.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTBezierPath.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Extensions/LOTBezierPath.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeCircle.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeCircle.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeStroke.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeStroke.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAnimatorNode.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/LOTAnimatorNode.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTComposition.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTComposition.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTKeyframe.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/AnimatableProperties/LOTKeyframe.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTRenderNode.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/LOTRenderNode.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeRectangle.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeRectangle.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeRepeater.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeRepeater.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeTransform.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeTransform.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeTrimPath.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeTrimPath.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/UIColor+Expanded.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Extensions/UIColor+Expanded.h -------------------------------------------------------------------------------- /Pods/Headers/Public/lottie-ios/Lottie/LOTComposition.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTComposition.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/CALayer+Compat.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/MacCompatability/CALayer+Compat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAnimationCache.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAnimationView.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationView.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTBezierData.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/AnimatableProperties/LOTBezierData.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTCacheProvider.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTCacheProvider.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTShapeGradientFill.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Models/LOTShapeGradientFill.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/NSValue+Compat.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/MacCompatability/NSValue+Compat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/lottie-ios/Lottie/LOTAnimationCache.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/lottie-ios/Lottie/LOTAnimationView.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationView.h -------------------------------------------------------------------------------- /Pods/Headers/Public/lottie-ios/Lottie/LOTCacheProvider.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTCacheProvider.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTLayerContainer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/AnimatableLayers/LOTLayerContainer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTMaskContainer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/AnimatableLayers/LOTMaskContainer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTPlatformCompat.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/MacCompatability/LOTPlatformCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTRenderGroup.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRenderGroup.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/CGGeometry+LOTAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Extensions/CGGeometry+LOTAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAnimationView_Internal.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Private/LOTAnimationView_Internal.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTFillRenderer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTFillRenderer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTPathAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPathAnimator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTRadialGradientLayer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/Extensions/LOTRadialGradientLayer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAnimationView_Compat.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationView_Compat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTCircleAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTCircleAnimator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTCompositionContainer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/AnimatableLayers/LOTCompositionContainer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTPolygonAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolygonAnimator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTRepeaterRenderer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRepeaterRenderer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTStrokeRenderer.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTStrokeRenderer.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTTrimPathNode.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/ManipulatorNodes/LOTTrimPathNode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/lottie-ios/Lottie/LOTAnimationView_Compat.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationView_Compat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTGradientFillRender.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTGradientFillRender.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTPolystarAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolystarAnimator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTArrayInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTArrayInterpolator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTColorInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTColorInterpolator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTNumberInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTNumberInterpolator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTPathInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPathInterpolator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTPointInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPointInterpolator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTRoundedRectAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTRoundedRectAnimator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTSizeInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTSizeInterpolator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTValueInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTValueInterpolator.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTAnimationTransitionController.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationTransitionController.h -------------------------------------------------------------------------------- /Pods/Headers/Public/lottie-ios/Lottie/LOTAnimationTransitionController.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationTransitionController.h -------------------------------------------------------------------------------- /Pods/Headers/Private/lottie-ios/Lottie/LOTTransformInterpolator.h: -------------------------------------------------------------------------------- 1 | ../../../../lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTTransformInterpolator.h -------------------------------------------------------------------------------- /Pods/Target Support Files/lottie-ios/lottie-ios-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_lottie_ios : NSObject 3 | @end 4 | @implementation PodsDummy_lottie_ios 5 | @end 6 | -------------------------------------------------------------------------------- /DYLottieDemo.xcworkspace/xcuserdata/yaolongkang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DYLottieDemo 2 | = 3 | 喜欢的朋友可以下载下来,如果代码对你有所帮助,还请给个Star,非常感谢你的支持! 4 | = 5 | * Airbnb的动画框架小demo 6 | 7 | 随后我会翻译出官方的iOS文档,供大家使用。 8 | 9 | - 使用过程中有问题请加QQ或发邮件:584379066 备注:Git Lottie 10 | 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DYLottieDemo/Pods-DYLottieDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_DYLottieDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_DYLottieDemo 5 | @end 6 | -------------------------------------------------------------------------------- /DYLottieDemo.xcworkspace/xcuserdata/yaolongkang.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/DYLottieDemo/HEAD/DYLottieDemo.xcworkspace/xcuserdata/yaolongkang.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DYLottieDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DYLottieDemo.xcodeproj/project.xcworkspace/xcuserdata/yaolongkang.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielYK/DYLottieDemo/HEAD/DYLottieDemo.xcodeproj/project.xcworkspace/xcuserdata/yaolongkang.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - lottie-ios (2.0.5) 3 | 4 | DEPENDENCIES: 5 | - lottie-ios 6 | 7 | SPEC CHECKSUMS: 8 | lottie-ios: d574e45532c6c06ac03c6d6649f759fb1137297b 9 | 10 | PODFILE CHECKSUM: e5dea33a0238a8ef2493c7459e1443121e55248d 11 | 12 | COCOAPODS: 1.3.1 13 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - lottie-ios (2.0.5) 3 | 4 | DEPENDENCIES: 5 | - lottie-ios 6 | 7 | SPEC CHECKSUMS: 8 | lottie-ios: d574e45532c6c06ac03c6d6649f759fb1137297b 9 | 10 | PODFILE CHECKSUM: e5dea33a0238a8ef2493c7459e1443121e55248d 11 | 12 | COCOAPODS: 1.3.1 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/lottie-ios/lottie-ios-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /DYLottieDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DYLottieDemo 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DYLottieDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DYLottieDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DYLottieDemo 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DYLottieDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DYLottieDemo 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/LOTRenderNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTRenderNode.h 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | 11 | @interface LOTRenderNode : LOTAnimatorNode 12 | 13 | @property (nonatomic, readonly, strong) CAShapeLayer * _Nonnull outputLayer; 14 | 15 | - (NSDictionary * _Nonnull)actionsForRenderLayer; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/MacCompatability/CALayer+Compat.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Oleksii Pavlovskyi on 2/2/17. 3 | // Copyright (c) 2017 Airbnb. All rights reserved. 4 | // 5 | 6 | #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR 7 | #import 8 | #import 9 | 10 | @interface CALayer (Compat) 11 | 12 | @property (nonatomic, assign) BOOL allowsEdgeAntialiasing; 13 | 14 | @end 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/MacCompatability/CALayer+Compat.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Oleksii Pavlovskyi on 2/2/17. 3 | // Copyright (c) 2017 Airbnb. All rights reserved. 4 | // 5 | 6 | #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR 7 | #import "CALayer+Compat.h" 8 | 9 | @implementation CALayer (Compat) 10 | 11 | - (BOOL)allowsEdgeAntialiasing { return NO; } 12 | - (void)setAllowsEdgeAntialiasing:(BOOL)allowsEdgeAntialiasing { } 13 | 14 | @end 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Private/LOTCacheProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTCacheProvider.m 3 | // Lottie 4 | // 5 | // Created by punmy on 2017/7/8. 6 | // 7 | // 8 | 9 | #import "LOTCacheProvider.h" 10 | 11 | @implementation LOTCacheProvider 12 | 13 | static id _imageCache; 14 | 15 | + (id)imageCache { 16 | return _imageCache; 17 | } 18 | 19 | + (void)setImageCache:(id)cache { 20 | _imageCache = cache; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTSizeInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTSizeInterpolator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/13/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTValueInterpolator.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LOTSizeInterpolator : LOTValueInterpolator 14 | 15 | - (CGSize)sizeValueForFrame:(NSNumber *)frame; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPointInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPointInterpolator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/12/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTValueInterpolator.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LOTPointInterpolator : LOTValueInterpolator 14 | 15 | - (CGPoint)pointValueForFrame:(NSNumber *)frame; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPathAnimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPathAnimator.h 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | #import "LOTShapePath.h" 11 | 12 | @interface LOTPathAnimator : LOTAnimatorNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 15 | shapePath:(LOTShapePath *_Nonnull)shapePath; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTArrayInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTArrayInterpolator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTValueInterpolator.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LOTArrayInterpolator : LOTValueInterpolator 14 | 15 | - (NSArray *)numberArrayForFrame:(NSNumber *)frame; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/AnimatableLayers/LOTMaskContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTMaskContainer.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/19/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTMask.h" 11 | 12 | @interface LOTMaskContainer : CALayer 13 | 14 | - (instancetype _Nonnull)initWithMasks:(NSArray * _Nonnull)masks; 15 | 16 | @property (nonatomic, strong, nullable) NSNumber *currentFrame; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTColorInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTColorInterpolator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/13/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTValueInterpolator.h" 10 | #import "LOTPlatformCompat.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LOTColorInterpolator : LOTValueInterpolator 15 | 16 | - (UIColor *)colorForFrame:(NSNumber *)frame; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTNumberInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTNumberInterpolator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/11/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTValueInterpolator.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | @interface LOTNumberInterpolator : LOTValueInterpolator 14 | 15 | - (CGFloat)floatValueForFrame:(NSNumber *)frame; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTFillRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTFillRenderer.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTRenderNode.h" 10 | #import "LOTShapeFill.h" 11 | 12 | @interface LOTFillRenderer : LOTRenderNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nonnull)inputNode 15 | shapeFill:(LOTShapeFill *_Nonnull)fill; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolygonAnimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPolygonAnimator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | #import "LOTShapeStar.h" 11 | 12 | @interface LOTPolygonAnimator : LOTAnimatorNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 15 | shapePolygon:(LOTShapeStar *_Nonnull)shapeStar; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolystarAnimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPolystarAnimator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | #import "LOTShapeStar.h" 11 | 12 | @interface LOTPolystarAnimator : LOTAnimatorNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 15 | shapeStar:(LOTShapeStar *_Nonnull)shapeStar; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/ManipulatorNodes/LOTTrimPathNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTTrimPathNode.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/21/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | #import "LOTShapeTrimPath.h" 11 | 12 | @interface LOTTrimPathNode : LOTAnimatorNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 15 | trimPath:(LOTShapeTrimPath *_Nonnull)trimPath; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTStrokeRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTStrokeRenderer.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/17/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTRenderNode.h" 10 | #import "LOTShapeStroke.h" 11 | 12 | @interface LOTStrokeRenderer : LOTRenderNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nonnull)inputNode 15 | shapeStroke:(LOTShapeStroke *_Nonnull)stroke; 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTCircleAnimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTCircleAnimator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/19/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | #import "LOTShapeCircle.h" 11 | 12 | @interface LOTCircleAnimator : LOTAnimatorNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 15 | shapeCircle:(LOTShapeCircle *_Nonnull)shapeCircle; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRepeaterRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTRepeaterRenderer.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/28/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTRenderNode.h" 10 | #import "LOTShapeRepeater.h" 11 | 12 | @interface LOTRepeaterRenderer : LOTRenderNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nonnull)inputNode 15 | shapeRepeater:(LOTShapeRepeater *_Nonnull)repeater; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTGradientFillRender.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTGradientFillRender.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTRenderNode.h" 10 | #import "LOTShapeGradientFill.h" 11 | 12 | @interface LOTGradientFillRender : LOTRenderNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nonnull)inputNode 15 | shapeGradientFill:(LOTShapeGradientFill *_Nonnull)fill; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTRoundedRectAnimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTRoundedRectAnimator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/19/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | #import "LOTShapeRectangle.h" 11 | 12 | @interface LOTRoundedRectAnimator : LOTAnimatorNode 13 | 14 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 15 | shapeRectangle:(LOTShapeRectangle *_Nonnull)shapeRectangle; 16 | 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPathInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPathInterpolator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/13/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTValueInterpolator.h" 10 | #import "LOTPlatformCompat.h" 11 | #import "LOTBezierPath.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface LOTPathInterpolator : LOTValueInterpolator 16 | 17 | - (LOTBezierPath *)pathForFrame:(NSNumber *)frame cacheLengths:(BOOL)cacheLengths; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Private/LOTAnimationView_Internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimationView_Internal.h 3 | // Lottie 4 | // 5 | // Created by Brandon Withrow on 12/7/16. 6 | // Copyright © 2016 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimationView.h" 10 | 11 | typedef enum : NSUInteger { 12 | LOTConstraintTypeAlignToBounds, 13 | LOTConstraintTypeAlignToLayer, 14 | LOTConstraintTypeNone 15 | } LOTConstraintType; 16 | 17 | @interface LOTAnimationView () 18 | 19 | @property (nonatomic, copy, nullable) NSString *cacheKey; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/MacCompatability/NSValue+Compat.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Oleksii Pavlovskyi on 2/2/17. 3 | // Copyright (c) 2017 Airbnb. All rights reserved. 4 | // 5 | 6 | #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR 7 | #import 8 | 9 | @interface NSValue (Compat) 10 | 11 | + (NSValue *)valueWithCGRect:(CGRect)rect; 12 | + (NSValue *)valueWithCGPoint:(CGPoint)point; 13 | 14 | @property (nonatomic, readonly) CGRect CGRectValue; 15 | @property(nonatomic, readonly) CGPoint CGPointValue; 16 | @property (nonatomic, readonly) CGSize CGSizeValue; 17 | 18 | @end 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Extensions/LOTHelpers.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTHelpers.h 3 | // Lottie 4 | // 5 | // Created by Brandon Withrow on 7/28/16. 6 | // Copyright © 2016 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #ifndef LOTHelpers_h 10 | #define LOTHelpers_h 11 | 12 | #import "UIColor+Expanded.h" 13 | #import "CGGeometry+LOTAdditions.h" 14 | #import "LOTBezierPath.h" 15 | 16 | #define ENABLE_DEBUG_LOGGING NO 17 | #define ENABLE_DEBUG_SHAPES NO 18 | 19 | #endif /* LOTHelpers_h */ 20 | 21 | // TODO Feature Phase 22 | /* 23 | - Trim Path individually 24 | - Image Cache Support 25 | - Skew transform 26 | */ 27 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Extensions/LOTRadialGradientLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimationView 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | #import 9 | #import 10 | 11 | @interface LOTRadialGradientLayer : CALayer 12 | 13 | @property CGPoint startPoint; 14 | @property CGPoint endPoint; 15 | 16 | @property (nonatomic, copy) NSArray *colors; 17 | @property (nonatomic, copy) NSArray *locations; 18 | @property (nonatomic, assign) BOOL isRadial; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapePath.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapePath.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | @interface LOTShapePath : NSObject 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 15 | 16 | @property (nonatomic, readonly) NSString *keyname; 17 | @property (nonatomic, readonly) BOOL closed; 18 | @property (nonatomic, readonly) NSNumber *index; 19 | @property (nonatomic, readonly) LOTKeyframeGroup *shapePath; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShape.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface LOTShapeGroup : NSObject 13 | 14 | - (instancetype _Nonnull)initWithJSON:(NSDictionary *_Nonnull)jsonDictionary; 15 | 16 | @property (nonatomic, readonly, nonnull) NSString *keyname; 17 | @property (nonatomic, readonly, nonnull) NSArray *items; 18 | 19 | + (id _Nullable)shapeItemWithJSON:(NSDictionary * _Nonnull)itemJSON; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRenderGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTRenderGroup.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTRenderNode.h" 10 | 11 | @interface LOTRenderGroup : LOTRenderNode 12 | 13 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode * _Nullable)inputNode 14 | contents:(NSArray * _Nonnull)contents 15 | keyname:(NSString * _Nullable)keyname; 16 | 17 | @property (nonatomic, strong, readonly) CALayer * _Nonnull containerLayer; 18 | 19 | @end 20 | 21 | 22 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeTrimPath.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeTrimPath.h 3 | // LottieAnimator 4 | // 5 | // Created by brandon_withrow on 7/26/16. 6 | // Copyright © 2016 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | @interface LOTShapeTrimPath : NSObject 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 15 | 16 | @property (nonatomic, readonly) NSString *keyname; 17 | @property (nonatomic, readonly) LOTKeyframeGroup *start; 18 | @property (nonatomic, readonly) LOTKeyframeGroup *end; 19 | @property (nonatomic, readonly) LOTKeyframeGroup *offset; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/Target Support Files/lottie-ios/lottie-ios.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/lottie-ios 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/lottie-ios" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/lottie-ios" 4 | OTHER_LDFLAGS = -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/lottie-ios 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DYLottieDemo/Pods-DYLottieDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/lottie-ios" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/lottie-ios" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/lottie-ios" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"lottie-ios" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DYLottieDemo/Pods-DYLottieDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/lottie-ios" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/lottie-ios" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/lottie-ios" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"lottie-ios" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeCircle.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeCircle.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LOTShapeCircle : NSObject 15 | 16 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 17 | 18 | @property (nonatomic, readonly) NSString *keyname; 19 | @property (nonatomic, readonly) LOTKeyframeGroup *position; 20 | @property (nonatomic, readonly) LOTKeyframeGroup *size; 21 | @property (nonatomic, readonly) BOOL reversed; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeRectangle.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeRectangle.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | @interface LOTShapeRectangle : NSObject 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 15 | 16 | @property (nonatomic, readonly) NSString *keyname; 17 | @property (nonatomic, readonly) LOTKeyframeGroup *position; 18 | @property (nonatomic, readonly) LOTKeyframeGroup *size; 19 | @property (nonatomic, readonly) LOTKeyframeGroup *cornerRadius; 20 | @property (nonatomic, readonly) BOOL reversed; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/AnimatableProperties/LOTBezierData.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTBezierData.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/10/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LOTBezierData : NSObject 15 | 16 | - (instancetype)initWithData:(NSDictionary *)bezierData; 17 | 18 | @property (nonatomic, readonly) NSInteger count; 19 | @property (nonatomic, readonly) BOOL closed; 20 | 21 | - (CGPoint)vertexAtIndex:(NSInteger)index; 22 | - (CGPoint)inTangentAtIndex:(NSInteger)index; 23 | - (CGPoint)outTangentAtIndex:(NSInteger)index; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTLayerGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTLayerGroup.h 3 | // Pods 4 | // 5 | // Created by Brandon Withrow on 2/16/17. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class LOTLayer; 15 | @class LOTAssetGroup; 16 | 17 | @interface LOTLayerGroup : NSObject 18 | 19 | - (instancetype)initWithLayerJSON:(NSArray *)layersJSON 20 | withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup; 21 | 22 | @property (nonatomic, readonly) NSArray *layers; 23 | 24 | - (LOTLayer *)layerModelForID:(NSNumber *)layerID; 25 | - (LOTLayer *)layerForReferenceID:(NSString *)referenceID; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/MacCompatability/NSValue+Compat.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Oleksii Pavlovskyi on 2/2/17. 3 | // Copyright (c) 2017 Airbnb. All rights reserved. 4 | // 5 | 6 | #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR 7 | #import "NSValue+Compat.h" 8 | 9 | @implementation NSValue (Compat) 10 | 11 | + (NSValue *)valueWithCGRect:(CGRect)rect { 12 | return [self valueWithRect:rect]; 13 | } 14 | 15 | + (NSValue *)valueWithCGPoint:(CGPoint)point { 16 | return [self valueWithPoint:point]; 17 | } 18 | 19 | - (CGRect)CGRectValue { 20 | return self.rectValue; 21 | } 22 | 23 | - (CGPoint)CGPointValue { 24 | return self.pointValue; 25 | } 26 | 27 | - (CGSize)CGSizeValue { 28 | return self.sizeValue; 29 | } 30 | 31 | @end 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTModels.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTModels.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #ifndef LOTModels_h 10 | #define LOTModels_h 11 | 12 | #import "LOTKeyframe.h" 13 | #import "LOTComposition.h" 14 | #import "LOTLayer.h" 15 | #import "LOTMask.h" 16 | #import "LOTShapeCircle.h" 17 | #import "LOTShapeFill.h" 18 | #import "LOTShapeGroup.h" 19 | #import "LOTShapePath.h" 20 | #import "LOTShapeRectangle.h" 21 | #import "LOTShapeStroke.h" 22 | #import "LOTShapeTransform.h" 23 | #import "LOTShapeTrimPath.h" 24 | #import "LOTLayerGroup.h" 25 | #import "LOTAsset.h" 26 | #import "LOTShapeGradientFill.h" 27 | 28 | #endif /* LOTModels_h */ 29 | -------------------------------------------------------------------------------- /DYLottieDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DYLottieDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeFill.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeFill.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LOTShapeFill : NSObject 15 | 16 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 17 | 18 | @property (nonatomic, readonly) NSString *keyname; 19 | @property (nonatomic, readonly) BOOL fillEnabled; 20 | @property (nonatomic, readonly) LOTKeyframeGroup *color; 21 | @property (nonatomic, readonly) LOTKeyframeGroup *opacity; 22 | @property (nonatomic, readonly) BOOL evenOddFillRule; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /DYLottieDemo/DYAnimationVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // DYAnimationVC.h 3 | // DYLottieDemo 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef NS_ENUM (NSInteger,DYAnimationType){ 11 | kDYAnimationOne = 1, 12 | kDYAnimationTwo = 2, 13 | kDYAnimationThree = 3, 14 | kDYAnimationFour = 4, 15 | kDYAnimationFive = 5, 16 | kDYAnimationSix = 6, 17 | kDYAnimationSeven = 7, 18 | kDYAnimationEight = 8, 19 | kDYAnimationNine = 9, 20 | kDYAnimationTen = 10, 21 | }; 22 | 23 | @interface DYAnimationVC : UIViewController 24 | 25 | //@property(nonatomic,assign)NSInteger animationType; 26 | -(id)initWithAnimationType:(DYAnimationType)animationType; 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTAssetGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAssetGroup.h 3 | // Pods 4 | // 5 | // Created by Brandon Withrow on 2/17/17. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class LOTAsset; 13 | @class LOTLayerGroup; 14 | @interface LOTAssetGroup : NSObject 15 | @property (nonatomic, readwrite) NSString * _Nullable rootDirectory; 16 | @property (nonatomic, readonly, nullable) NSBundle *assetBundle; 17 | 18 | - (instancetype _Nonnull)initWithJSON:(NSArray * _Nonnull)jsonArray 19 | withAssetBundle:(NSBundle *_Nullable)bundle; 20 | 21 | - (void)buildAssetNamed:(NSString * _Nonnull)refID; 22 | 23 | - (void)finalizeInitialization; 24 | 25 | - (LOTAsset * _Nullable)assetModelForID:(NSString * _Nonnull)assetID; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/AnimatableLayers/LOTCompositionContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTCompositionContainer.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/18/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTLayerContainer.h" 10 | #import "LOTAssetGroup.h" 11 | 12 | @interface LOTCompositionContainer : LOTLayerContainer 13 | 14 | - (instancetype _Nonnull)initWithModel:(LOTLayer * _Nullable)layer 15 | inLayerGroup:(LOTLayerGroup * _Nullable)layerGroup 16 | withLayerGroup:(LOTLayerGroup * _Nullable)childLayerGroup 17 | withAssestGroup:(LOTAssetGroup * _Nullable)assetGroup; 18 | 19 | - (void)addSublayer:(nonnull CALayer *)subLayer 20 | toLayerNamed:(nonnull NSString *)layerName 21 | applyTransform:(BOOL)applyTransform; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/MacCompatability/LOTPlatformCompat.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPlatformCompat.h 3 | // Lottie 4 | // 5 | // Created by Oleksii Pavlovskyi on 2/2/17. 6 | // Copyright (c) 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #ifndef LOTPlatformCompat_h 10 | #define LOTPlatformCompat_h 11 | 12 | #import "TargetConditionals.h" 13 | 14 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 15 | 16 | #import 17 | 18 | #else 19 | 20 | #import 21 | #import "UIColor.h" 22 | #import "CALayer+Compat.h" 23 | #import "NSValue+Compat.h" 24 | 25 | NS_INLINE NSString *NSStringFromCGRect(CGRect rect) { 26 | return NSStringFromRect(rect); 27 | } 28 | 29 | NS_INLINE NSString *NSStringFromCGPoint(CGPoint point) { 30 | return NSStringFromPoint(point); 31 | } 32 | 33 | typedef NSEdgeInsets UIEdgeInsets; 34 | 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /DYLottieDemo.xcodeproj/xcuserdata/yaolongkang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DYLottieDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 3721C71E1F4C015400396D38 16 | 17 | primary 18 | 19 | 20 | 3721C7371F4C015400396D38 21 | 22 | primary 23 | 24 | 25 | 3721C7421F4C015400396D38 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/yaolongkang.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-DYLottieDemo.xcscheme 8 | 9 | isShown 10 | 11 | 12 | lottie-ios.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 314700CC4C56EB3C376F8F25B11A9F82 21 | 22 | primary 23 | 24 | 25 | 3610524FB0DE2022AA282A131B61AD8B 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeTransform.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeTransform.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "LOTKeyframe.h" 13 | 14 | @interface LOTShapeTransform : NSObject 15 | 16 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 17 | 18 | @property (nonatomic, readonly) NSString *keyname; 19 | @property (nonatomic, readonly) LOTKeyframeGroup *position; 20 | @property (nonatomic, readonly) LOTKeyframeGroup *anchor; 21 | @property (nonatomic, readonly) LOTKeyframeGroup *scale; 22 | @property (nonatomic, readonly) LOTKeyframeGroup *rotation; 23 | @property (nonatomic, readonly) LOTKeyframeGroup *opacity; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTValueInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTValueInterpolator.h 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 7/10/17. 6 | // 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LOTValueInterpolator : NSObject 15 | 16 | - (instancetype)initWithKeyframes:(NSArray *)keyframes; 17 | 18 | /// Used to dynamically update keyframe data. 19 | - (BOOL)setValue:(id)value atFrame:(NSNumber *)frame; 20 | - (id)keyframeDataForValue:(id)value; 21 | 22 | @property (nonatomic, weak, nullable) LOTKeyframe *leadingKeyframe; 23 | @property (nonatomic, weak, nullable) LOTKeyframe *trailingKeyframe; 24 | 25 | - (BOOL)hasUpdateForFrame:(NSNumber *)frame; 26 | - (CGFloat)progressForFrame:(NSNumber *)frame; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimationCache.h 3 | // Lottie 4 | // 5 | // Created by Brandon Withrow on 1/9/17. 6 | // Copyright © 2017 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @class LOTComposition; 14 | 15 | @interface LOTAnimationCache : NSObject 16 | 17 | /// Global Cache 18 | + (instancetype)sharedCache; 19 | 20 | /// Adds animation to the cache 21 | - (void)addAnimation:(LOTComposition *)animation forKey:(NSString *)key; 22 | 23 | /// Returns animation from cache. 24 | - (LOTComposition * _Nullable)animationForKey:(NSString *)key; 25 | 26 | /// Removes a specific animation from the cache 27 | - (void)removeAnimationForKey:(NSString *)key; 28 | 29 | /// Clears Everything from the Cache 30 | - (void)clearCache; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/PublicHeaders/LOTCacheProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTCacheProvider.h 3 | // Lottie 4 | // 5 | // Created by punmy on 2017/7/8. 6 | // 7 | // 8 | 9 | #import 10 | 11 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 12 | 13 | #import 14 | @compatibility_alias LOTImage UIImage; 15 | 16 | @protocol LOTImageCache; 17 | 18 | #pragma mark - LOTCacheProvider 19 | 20 | @interface LOTCacheProvider : NSObject 21 | 22 | + (id)imageCache; 23 | + (void)setImageCache:(id)cache; 24 | 25 | @end 26 | 27 | #pragma mark - LOTImageCache 28 | 29 | /** 30 | This protocol represent the interface of a image cache which lottie can use. 31 | */ 32 | @protocol LOTImageCache 33 | 34 | @required 35 | - (LOTImage *)imageForKey:(NSString *)key; 36 | - (void)setImage:(LOTImage *)image forKey:(NSString *)key; 37 | 38 | @end 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapePath.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapePath.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapePath.h" 10 | 11 | @implementation LOTShapePath 12 | 13 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 14 | self = [super init]; 15 | if (self) { 16 | [self _mapFromJSON:jsonDictionary]; 17 | } 18 | return self; 19 | } 20 | 21 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 22 | 23 | if (jsonDictionary[@"nm"] ) { 24 | _keyname = [jsonDictionary[@"nm"] copy]; 25 | } 26 | 27 | _index = jsonDictionary[@"ind"]; 28 | _closed = [jsonDictionary[@"closed"] boolValue]; 29 | NSDictionary *shape = jsonDictionary[@"ks"]; 30 | if (shape) { 31 | _shapePath = [[LOTKeyframeGroup alloc] initWithData:shape]; 32 | } 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/PublicHeaders/Lottie.h: -------------------------------------------------------------------------------- 1 | // 2 | // Lottie.h 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 1/27/17. 6 | // 7 | // 8 | 9 | #if __has_feature(modules) 10 | @import Foundation; 11 | #else 12 | #import 13 | #endif 14 | 15 | #ifndef Lottie_h 16 | #define Lottie_h 17 | 18 | //! Project version number for Lottie. 19 | FOUNDATION_EXPORT double LottieVersionNumber; 20 | 21 | //! Project version string for Lottie. 22 | FOUNDATION_EXPORT const unsigned char LottieVersionString[]; 23 | 24 | #include 25 | 26 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 27 | #import "LOTAnimationTransitionController.h" 28 | #endif 29 | 30 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 31 | #import "LOTCacheProvider.h" 32 | #endif 33 | 34 | #import "LOTAnimationView.h" 35 | #import "LOTAnimationCache.h" 36 | #import "LOTComposition.h" 37 | 38 | #endif /* Lottie_h */ 39 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTNumberInterpolator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTNumberInterpolator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/11/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTNumberInterpolator.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTNumberInterpolator 13 | 14 | - (CGFloat)floatValueForFrame:(NSNumber *)frame { 15 | CGFloat progress = [self progressForFrame:frame]; 16 | if (progress == 0) { 17 | return self.leadingKeyframe.floatValue; 18 | } 19 | if (progress == 1) { 20 | return self.trailingKeyframe.floatValue; 21 | } 22 | return LOT_RemapValue(progress, 0, 1, self.leadingKeyframe.floatValue, self.trailingKeyframe.floatValue); 23 | } 24 | 25 | - (id)keyframeDataForValue:(id)value { 26 | if ([value isKindOfClass:[NSNumber class]]) { 27 | return value; 28 | } 29 | return nil; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTMask.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTMask.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | typedef enum : NSUInteger { 13 | LOTMaskModeAdd, 14 | LOTMaskModeSubtract, 15 | LOTMaskModeIntersect, 16 | LOTMaskModeUnknown 17 | } LOTMaskMode; 18 | 19 | @interface LOTMask : NSObject 20 | 21 | - (instancetype _Nonnull)initWithJSON:(NSDictionary * _Nonnull)jsonDictionary; 22 | 23 | @property (nonatomic, readonly) BOOL closed; 24 | @property (nonatomic, readonly) BOOL inverted; 25 | @property (nonatomic, readonly) LOTMaskMode maskMode; 26 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *maskPath; 27 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *opacity; 28 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *expansion; 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationView_Compat.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimationView_Compat.h 3 | // Lottie 4 | // 5 | // Created by Oleksii Pavlovskyi on 2/2/17. 6 | // Copyright (c) 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 10 | 11 | #import 12 | @compatibility_alias LOTView UIView; 13 | 14 | #else 15 | 16 | #import 17 | @compatibility_alias LOTView NSView; 18 | 19 | typedef NS_ENUM(NSInteger, LOTViewContentMode) { 20 | LOTViewContentModeScaleToFill, 21 | LOTViewContentModeScaleAspectFit, 22 | LOTViewContentModeScaleAspectFill, 23 | LOTViewContentModeRedraw, 24 | LOTViewContentModeCenter, 25 | LOTViewContentModeTop, 26 | LOTViewContentModeBottom, 27 | LOTViewContentModeLeft, 28 | LOTViewContentModeRight, 29 | LOTViewContentModeTopLeft, 30 | LOTViewContentModeTopRight, 31 | LOTViewContentModeBottomLeft, 32 | LOTViewContentModeBottomRight, 33 | }; 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeCircle.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeCircle.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeCircle.h" 10 | 11 | @implementation LOTShapeCircle 12 | 13 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 14 | self = [super init]; 15 | if (self) { 16 | [self _mapFromJSON:jsonDictionary]; 17 | } 18 | return self; 19 | } 20 | 21 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 22 | 23 | if (jsonDictionary[@"nm"] ) { 24 | _keyname = [jsonDictionary[@"nm"] copy]; 25 | } 26 | 27 | NSDictionary *position = jsonDictionary[@"p"]; 28 | if (position) { 29 | _position = [[LOTKeyframeGroup alloc] initWithData:position]; 30 | } 31 | 32 | NSDictionary *size= jsonDictionary[@"s"]; 33 | if (size) { 34 | _size = [[LOTKeyframeGroup alloc] initWithData:size]; 35 | } 36 | NSNumber *reversed = jsonDictionary[@"d"]; 37 | _reversed = (reversed.integerValue == 3); 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DYLottieDemoTests/DYLottieDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DYLottieDemoTests.m 3 | // DYLottieDemoTests 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DYLottieDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DYLottieDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeGradientFill.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeGradientFill.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/26/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | typedef enum : NSUInteger { 15 | LOTGradientTypeLinear, 16 | LOTGradientTypeRadial 17 | } LOTGradientType; 18 | 19 | @interface LOTShapeGradientFill : NSObject 20 | 21 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 22 | 23 | @property (nonatomic, readonly) NSString *keyname; 24 | @property (nonatomic, readonly) NSNumber *numberOfColors; 25 | @property (nonatomic, readonly) LOTKeyframeGroup *startPoint; 26 | @property (nonatomic, readonly) LOTKeyframeGroup *endPoint; 27 | @property (nonatomic, readonly) LOTKeyframeGroup *gradient; 28 | @property (nonatomic, readonly) LOTKeyframeGroup *opacity; 29 | @property (nonatomic, readonly) BOOL evenOddFillRule; 30 | @property (nonatomic, readonly) LOTGradientType type; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/PublicHeaders/LOTComposition.h: -------------------------------------------------------------------------------- 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 | 9 | #import 10 | #import 11 | 12 | @class LOTLayerGroup; 13 | @class LOTLayer; 14 | @class LOTAssetGroup; 15 | 16 | @interface LOTComposition : NSObject 17 | 18 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary 19 | withAssetBundle:(NSBundle *)bundle; 20 | 21 | @property (nonatomic, readonly) CGRect compBounds; 22 | @property (nonatomic, readonly) NSNumber *startFrame; 23 | @property (nonatomic, readonly) NSNumber *endFrame; 24 | @property (nonatomic, readonly) NSNumber *framerate; 25 | @property (nonatomic, readonly) NSTimeInterval timeDuration; 26 | @property (nonatomic, readonly) LOTLayerGroup *layerGroup; 27 | @property (nonatomic, readonly) LOTAssetGroup *assetGroup; 28 | @property (nonatomic, readwrite) NSString *rootDirectory; 29 | @property (nonatomic, readonly) NSBundle *assetBundle; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTArrayInterpolator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTArrayInterpolator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTArrayInterpolator.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTArrayInterpolator 13 | 14 | - (NSArray *)numberArrayForFrame:(NSNumber *)frame { 15 | CGFloat progress = [self progressForFrame:frame]; 16 | if (progress == 0) { 17 | return self.leadingKeyframe.arrayValue; 18 | } 19 | if (progress == 1) { 20 | return self.trailingKeyframe.arrayValue; 21 | } 22 | NSMutableArray *returnArray = [NSMutableArray array]; 23 | for (int i = 0; i < self.leadingKeyframe.arrayValue.count; i ++) { 24 | CGFloat from = [(NSNumber *)self.leadingKeyframe.arrayValue[i] floatValue]; 25 | CGFloat to = [(NSNumber *)self.trailingKeyframe.arrayValue[i] floatValue]; 26 | CGFloat value = LOT_RemapValue(progress, 0, 1, from, to); 27 | [returnArray addObject:@(value)]; 28 | } 29 | return returnArray; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 DanielYK 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeRepeater.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeRepeater.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/28/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LOTShapeRepeater : NSObject 15 | 16 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 17 | 18 | @property (nonatomic, readonly) NSString *keyname; 19 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *copies; 20 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *offset; 21 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *anchorPoint; 22 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *scale; 23 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *position; 24 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *rotation; 25 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *startOpacity; 26 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *endOpacity; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTColorInterpolator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTColorInterpolator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/13/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTColorInterpolator.h" 10 | #import "LOTPlatformCompat.h" 11 | #import "UIColor+Expanded.h" 12 | 13 | @implementation LOTColorInterpolator 14 | 15 | - (UIColor *)colorForFrame:(NSNumber *)frame { 16 | CGFloat progress = [self progressForFrame:frame]; 17 | if (progress == 0) { 18 | return self.leadingKeyframe.colorValue; 19 | } 20 | if (progress == 1) { 21 | return self.trailingKeyframe.colorValue; 22 | } 23 | UIColor *returnColor = [UIColor LOT_colorByLerpingFromColor:self.leadingKeyframe.colorValue toColor:self.trailingKeyframe.colorValue amount:progress]; 24 | return returnColor; 25 | } 26 | 27 | - (id)keyframeDataForValue:(id)value { 28 | if ([value isKindOfClass:[UIColor class]]) { 29 | NSArray *colorComponents = [(UIColor *)value LOT_arrayFromRGBAComponents]; 30 | return colorComponents; 31 | } 32 | return nil; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeTrimPath.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeTrimPath.m 3 | // LottieAnimator 4 | // 5 | // Created by brandon_withrow on 7/26/16. 6 | // Copyright © 2016 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeTrimPath.h" 10 | 11 | @implementation LOTShapeTrimPath 12 | 13 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 14 | self = [super init]; 15 | if (self) { 16 | [self _mapFromJSON:jsonDictionary]; 17 | } 18 | return self; 19 | } 20 | 21 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 22 | 23 | if (jsonDictionary[@"nm"] ) { 24 | _keyname = [jsonDictionary[@"nm"] copy]; 25 | } 26 | 27 | NSDictionary *start = jsonDictionary[@"s"]; 28 | if (start) { 29 | _start = [[LOTKeyframeGroup alloc] initWithData:start]; 30 | } 31 | 32 | NSDictionary *end = jsonDictionary[@"e"]; 33 | if (end) { 34 | _end = [[LOTKeyframeGroup alloc] initWithData:end]; 35 | } 36 | 37 | NSDictionary *offset = jsonDictionary[@"o"]; 38 | if (offset) { 39 | _offset = [[LOTKeyframeGroup alloc] initWithData:offset]; 40 | } 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeStar.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeStar.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | typedef enum : NSUInteger { 13 | LOTPolystarShapeNone, 14 | LOTPolystarShapeStar, 15 | LOTPolystarShapePolygon 16 | } LOTPolystarShape; 17 | 18 | @interface LOTShapeStar : NSObject 19 | 20 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 21 | 22 | @property (nonatomic, readonly) NSString *keyname; 23 | @property (nonatomic, readonly) LOTKeyframeGroup *outerRadius; 24 | @property (nonatomic, readonly) LOTKeyframeGroup *outerRoundness; 25 | 26 | @property (nonatomic, readonly) LOTKeyframeGroup *innerRadius; 27 | @property (nonatomic, readonly) LOTKeyframeGroup *innerRoundness; 28 | 29 | @property (nonatomic, readonly) LOTKeyframeGroup *position; 30 | @property (nonatomic, readonly) LOTKeyframeGroup *numberOfPoints; 31 | @property (nonatomic, readonly) LOTKeyframeGroup *rotation; 32 | 33 | @property (nonatomic, readonly) LOTPolystarShape type; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTAsset.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAsset.h 3 | // Pods 4 | // 5 | // Created by Brandon Withrow on 2/16/17. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class LOTLayerGroup; 15 | @class LOTLayer; 16 | @class LOTAssetGroup; 17 | 18 | @interface LOTAsset : NSObject 19 | 20 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary 21 | withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup 22 | withAssetBundle:(NSBundle *_Nonnull)bundle; 23 | 24 | @property (nonatomic, readonly, nullable) NSString *referenceID; 25 | @property (nonatomic, readonly, nullable) NSNumber *assetWidth; 26 | @property (nonatomic, readonly, nullable) NSNumber *assetHeight; 27 | 28 | @property (nonatomic, readonly, nullable) NSString *imageName; 29 | @property (nonatomic, readonly, nullable) NSString *imageDirectory; 30 | 31 | @property (nonatomic, readonly, nullable) LOTLayerGroup *layerGroup; 32 | 33 | @property (nonatomic, readwrite) NSString *rootDirectory; 34 | @property (nonatomic, readonly) NSBundle *assetBundle; 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPathAnimator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPathAnimator.m 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // 7 | // 8 | 9 | #import "LOTPathAnimator.h" 10 | #import "LOTPathInterpolator.h" 11 | 12 | @implementation LOTPathAnimator { 13 | LOTShapePath *_pathConent; 14 | LOTPathInterpolator *_interpolator; 15 | } 16 | 17 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 18 | shapePath:(LOTShapePath *_Nonnull)shapePath { 19 | self = [super initWithInputNode:inputNode keyName:shapePath.keyname]; 20 | if (self) { 21 | _pathConent = shapePath; 22 | _interpolator = [[LOTPathInterpolator alloc] initWithKeyframes:_pathConent.shapePath.keyframes]; 23 | } 24 | return self; 25 | } 26 | 27 | - (NSDictionary *)valueInterpolators { 28 | return @{@"Path" : _interpolator}; 29 | } 30 | 31 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 32 | return [_interpolator hasUpdateForFrame:frame]; 33 | 34 | } 35 | 36 | - (void)performLocalUpdate { 37 | self.localPath = [_interpolator pathForFrame:self.currentFrame cacheLengths:self.pathShouldCacheLengths]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTSizeInterpolator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTSizeInterpolator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/13/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTPlatformCompat.h" 10 | #import "LOTSizeInterpolator.h" 11 | #import "CGGeometry+LOTAdditions.h" 12 | 13 | @implementation LOTSizeInterpolator 14 | 15 | - (CGSize)sizeValueForFrame:(NSNumber *)frame { 16 | CGFloat progress = [self progressForFrame:frame]; 17 | if (progress == 0) { 18 | return self.leadingKeyframe.sizeValue; 19 | } 20 | if (progress == 1) { 21 | return self.trailingKeyframe.sizeValue; 22 | } 23 | return CGSizeMake(LOT_RemapValue(progress, 0, 1, self.leadingKeyframe.sizeValue.width, self.trailingKeyframe.sizeValue.width), 24 | LOT_RemapValue(progress, 0, 1, self.leadingKeyframe.sizeValue.height, self.trailingKeyframe.sizeValue.height)); 25 | } 26 | 27 | - (id)keyframeDataForValue:(id)value { 28 | if ([value isKindOfClass:[NSValue class]]) { 29 | CGSize sizeValue = [(NSValue *)value CGSizeValue]; 30 | return @[@(sizeValue.width), @(sizeValue.height)]; 31 | } 32 | return nil; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/AnimatableLayers/LOTLayerContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTLayerContainer.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/18/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTPlatformCompat.h" 10 | #import "LOTLayer.h" 11 | #import "LOTLayerGroup.h" 12 | 13 | @interface LOTLayerContainer : CALayer 14 | 15 | - (instancetype _Nonnull )initWithModel:(LOTLayer * _Nullable)layer 16 | inLayerGroup:(LOTLayerGroup * _Nullable)layerGroup; 17 | 18 | @property (nonatomic, readonly, strong, nullable) NSString *layerName; 19 | @property (nonatomic, nullable) NSNumber *currentFrame; 20 | @property (nonatomic, assign) CGRect viewportBounds; 21 | @property (nonatomic, readonly, nonnull) CALayer *wrapperLayer; 22 | - (void)displayWithFrame:(NSNumber * _Nonnull)frame; 23 | - (void)displayWithFrame:(NSNumber * _Nonnull)frame forceUpdate:(BOOL)forceUpdate; 24 | 25 | - (void)addAndMaskSublayer:(nonnull CALayer *)subLayer; 26 | 27 | - (BOOL)setValue:(nonnull id)value 28 | forKeypath:(nonnull NSString *)keypath 29 | atFrame:(nullable NSNumber *)frame; 30 | 31 | - (void)logHierarchyKeypathsWithParent:(NSString * _Nullable)parent; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeStroke.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeStroke.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTKeyframe.h" 11 | 12 | typedef enum : NSUInteger { 13 | LOTLineCapTypeButt, 14 | LOTLineCapTypeRound, 15 | LOTLineCapTypeUnknown 16 | } LOTLineCapType; 17 | 18 | typedef enum : NSUInteger { 19 | LOTLineJoinTypeMiter, 20 | LOTLineJoinTypeRound, 21 | LOTLineJoinTypeBevel 22 | } LOTLineJoinType; 23 | 24 | @interface LOTShapeStroke : NSObject 25 | 26 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary; 27 | 28 | @property (nonatomic, readonly) NSString *keyname; 29 | @property (nonatomic, readonly) BOOL fillEnabled; 30 | @property (nonatomic, readonly) LOTKeyframeGroup *color; 31 | @property (nonatomic, readonly) LOTKeyframeGroup *opacity; 32 | @property (nonatomic, readonly) LOTKeyframeGroup *width; 33 | @property (nonatomic, readonly) LOTKeyframeGroup *dashOffset; 34 | @property (nonatomic, readonly) LOTLineCapType capType; 35 | @property (nonatomic, readonly) LOTLineJoinType joinType; 36 | 37 | @property (nonatomic, readonly) NSArray *lineDashPattern; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeRectangle.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeRectangle.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeRectangle.h" 10 | 11 | @implementation LOTShapeRectangle 12 | 13 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 14 | self = [super init]; 15 | if (self) { 16 | [self _mapFromJSON:jsonDictionary]; 17 | } 18 | return self; 19 | } 20 | 21 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 22 | 23 | if (jsonDictionary[@"nm"] ) { 24 | _keyname = [jsonDictionary[@"nm"] copy]; 25 | } 26 | 27 | NSDictionary *position = jsonDictionary[@"p"]; 28 | if (position) { 29 | _position = [[LOTKeyframeGroup alloc] initWithData:position]; 30 | } 31 | 32 | NSDictionary *cornerRadius = jsonDictionary[@"r"]; 33 | if (cornerRadius) { 34 | _cornerRadius = [[LOTKeyframeGroup alloc] initWithData:cornerRadius]; 35 | } 36 | 37 | NSDictionary *size = jsonDictionary[@"s"]; 38 | if (size) { 39 | _size = [[LOTKeyframeGroup alloc] initWithData:size]; 40 | } 41 | NSNumber *reversed = jsonDictionary[@"d"]; 42 | _reversed = (reversed.integerValue == 3); 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/LOTRenderNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTRenderNode.m 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // 7 | // 8 | 9 | #import "LOTRenderNode.h" 10 | 11 | @implementation LOTRenderNode 12 | 13 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 14 | keyName:(NSString * _Nullable)keyname { 15 | self = [super initWithInputNode:inputNode keyName:keyname]; 16 | if (self) { 17 | _outputLayer = [CAShapeLayer new]; 18 | _outputLayer.actions = [self actionsForRenderLayer]; 19 | } 20 | return self; 21 | } 22 | 23 | /// Layer Properties that need to disable implicit animations 24 | - (NSDictionary * _Nonnull)actionsForRenderLayer { 25 | return @{@"path": [NSNull null]}; 26 | } 27 | 28 | /// Local interpolatores have changed. Update layer specific properties. 29 | - (void)performLocalUpdate { 30 | 31 | } 32 | 33 | /// The path for rendering has changed. Do any rendering required. 34 | - (void)rebuildOutputs { 35 | 36 | } 37 | 38 | - (LOTBezierPath *)localPath { 39 | return self.inputNode.localPath; 40 | } 41 | 42 | /// Forwards its input node's output path forwards downstream 43 | - (LOTBezierPath *)outputPath { 44 | return self.inputNode.outputPath; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /DYLottieDemoUITests/DYLottieDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DYLottieDemoUITests.m 3 | // DYLottieDemoUITests 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DYLottieDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation DYLottieDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DYLottieDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/MacCompatability/UIColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor.h 3 | // Lottie 4 | // 5 | // Created by Oleksii Pavlovskyi on 2/2/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR 10 | #import 11 | #import 12 | 13 | @interface UIColor : NSObject 14 | 15 | + (UIColor *)colorWithWhite:(CGFloat)white alpha:(CGFloat)alpha; 16 | + (UIColor *)colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha; 17 | + (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 18 | + (UIColor *)colorWithCGColor:(CGColorRef)cgColor; 19 | 20 | + (UIColor *)blackColor; 21 | + (UIColor *)darkGrayColor; 22 | + (UIColor *)lightGrayColor; 23 | + (UIColor *)whiteColor; 24 | + (UIColor *)grayColor; 25 | + (UIColor *)redColor; 26 | + (UIColor *)greenColor; 27 | + (UIColor *)blueColor; 28 | + (UIColor *)cyanColor; 29 | + (UIColor *)yellowColor; 30 | + (UIColor *)magentaColor; 31 | + (UIColor *)orangeColor; 32 | + (UIColor *)purpleColor; 33 | + (UIColor *)brownColor; 34 | + (UIColor *)clearColor; 35 | 36 | - (UIColor *)colorWithAlphaComponent:(CGFloat)alpha; 37 | 38 | @property (nonatomic, readonly) CGColorRef CGColor; 39 | 40 | @end 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeFill.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeFill.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeFill.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTShapeFill 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 15 | self = [super init]; 16 | if (self) { 17 | [self _mapFromJSON:jsonDictionary]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 23 | 24 | if (jsonDictionary[@"nm"] ) { 25 | _keyname = [jsonDictionary[@"nm"] copy]; 26 | } 27 | 28 | NSDictionary *color = jsonDictionary[@"c"]; 29 | if (color) { 30 | _color = [[LOTKeyframeGroup alloc] initWithData:color]; 31 | } 32 | 33 | NSDictionary *opacity = jsonDictionary[@"o"]; 34 | if (opacity) { 35 | _opacity = [[LOTKeyframeGroup alloc] initWithData:opacity]; 36 | [_opacity remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 37 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 38 | }]; 39 | } 40 | 41 | NSNumber *evenOdd = jsonDictionary[@"r"]; 42 | if (evenOdd.integerValue == 2) { 43 | _evenOddFillRule = YES; 44 | } else { 45 | _evenOddFillRule = NO; 46 | } 47 | 48 | NSNumber *fillEnabled = jsonDictionary[@"fillEnabled"]; 49 | _fillEnabled = fillEnabled.boolValue; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTAsset.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAsset.m 3 | // Pods 4 | // 5 | // Created by Brandon Withrow on 2/16/17. 6 | // 7 | // 8 | 9 | #import "LOTAsset.h" 10 | #import "LOTLayer.h" 11 | #import "LOTLayerGroup.h" 12 | #import "LOTAssetGroup.h" 13 | 14 | @implementation LOTAsset 15 | 16 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary 17 | withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup 18 | withAssetBundle:(NSBundle *_Nonnull)bundle { 19 | self = [super init]; 20 | if (self) { 21 | _assetBundle = bundle; 22 | [self _mapFromJSON:jsonDictionary 23 | withAssetGroup:assetGroup]; 24 | } 25 | return self; 26 | } 27 | 28 | 29 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary 30 | withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup{ 31 | _referenceID = [jsonDictionary[@"id"] copy]; 32 | 33 | if (jsonDictionary[@"w"]) { 34 | _assetWidth = [jsonDictionary[@"w"] copy]; 35 | } 36 | 37 | if (jsonDictionary[@"h"]) { 38 | _assetHeight = [jsonDictionary[@"h"] copy]; 39 | } 40 | 41 | if (jsonDictionary[@"u"]) { 42 | _imageDirectory = [jsonDictionary[@"u"] copy]; 43 | } 44 | 45 | if (jsonDictionary[@"p"]) { 46 | _imageName = [jsonDictionary[@"p"] copy]; 47 | } 48 | 49 | NSArray *layersJSON = jsonDictionary[@"layers"]; 50 | if (layersJSON) { 51 | _layerGroup = [[LOTLayerGroup alloc] initWithLayerJSON:layersJSON 52 | withAssetGroup:assetGroup]; 53 | } 54 | 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /DYLottieDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Extensions/LOTBezierPath.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTBezierPath.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/20/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTPlatformCompat.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LOTBezierPath : NSObject 14 | 15 | + (instancetype)newPath; 16 | 17 | - (void)LOT_moveToPoint:(CGPoint)point; 18 | 19 | - (void)LOT_addLineToPoint:(CGPoint)point; 20 | 21 | - (void)LOT_addCurveToPoint:(CGPoint)point 22 | controlPoint1:(CGPoint)cp1 23 | controlPoint2:(CGPoint)cp2; 24 | 25 | - (void)LOT_closePath; 26 | 27 | - (void)LOT_removeAllPoints; 28 | 29 | - (void)LOT_appendPath:(LOTBezierPath *)bezierPath; 30 | 31 | - (void)trimPathFromT:(CGFloat)fromT toT:(CGFloat)toT offset:(CGFloat)offset; 32 | 33 | - (void)LOT_applyTransform:(CGAffineTransform)transform; 34 | 35 | @property (nonatomic, assign) BOOL cacheLengths; 36 | 37 | @property (nonatomic, readonly) CGFloat length; 38 | 39 | @property (nonatomic, readonly) CGPathRef CGPath; 40 | @property (nonatomic, readonly) CGPoint currentPoint; 41 | @property (nonatomic) CGFloat lineWidth; 42 | @property (nonatomic) CGLineCap lineCapStyle; 43 | @property (nonatomic) CGLineJoin lineJoinStyle; 44 | @property (nonatomic) CGFloat miterLimit; 45 | @property (nonatomic) CGFloat flatness; 46 | @property (nonatomic) BOOL usesEvenOddFillRule; 47 | @property (readonly, getter=isEmpty) BOOL empty; 48 | @property (nonatomic, readonly) CGRect bounds; 49 | 50 | @end 51 | 52 | NS_ASSUME_NONNULL_END 53 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPointInterpolator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPointInterpolator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/12/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTPointInterpolator.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTPointInterpolator 13 | 14 | - (CGPoint)pointValueForFrame:(NSNumber *)frame { 15 | CGFloat progress = [self progressForFrame:frame]; 16 | if (progress == 0) { 17 | return self.leadingKeyframe.pointValue; 18 | } 19 | if (progress == 1) { 20 | return self.trailingKeyframe.pointValue; 21 | } 22 | if (!CGPointEqualToPoint(self.leadingKeyframe.spatialOutTangent, CGPointZero) && 23 | !CGPointEqualToPoint(self.trailingKeyframe.spatialInTangent, CGPointZero)) { 24 | // Spatial Bezier path 25 | CGPoint outTan = LOT_PointAddedToPoint(self.leadingKeyframe.pointValue, self.leadingKeyframe.spatialOutTangent); 26 | CGPoint inTan = LOT_PointAddedToPoint(self.trailingKeyframe.pointValue, self.trailingKeyframe.spatialInTangent); 27 | return LOT_PointInCubicCurve(self.leadingKeyframe.pointValue, outTan, inTan, self.trailingKeyframe.pointValue, progress); 28 | } 29 | return LOT_PointInLine(self.leadingKeyframe.pointValue, self.trailingKeyframe.pointValue, progress); 30 | } 31 | 32 | - (id)keyframeDataForValue:(id)value { 33 | if ([value isKindOfClass:[NSValue class]]) { 34 | CGPoint pointValue = [(NSValue *)value CGPointValue]; 35 | return @[@(pointValue.x), @(pointValue.y)]; 36 | } 37 | return nil; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/AnimatableProperties/LOTKeyframe.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTKeyframe.h 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 7/10/17. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | #import "LOTPlatformCompat.h" 12 | #import "LOTBezierData.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface LOTKeyframe : NSObject 17 | 18 | - (instancetype)initWithKeyframe:(NSDictionary *)keyframe; 19 | - (instancetype)initWithValue:(id)value; 20 | - (void)remapValueWithBlock:(CGFloat (^)(CGFloat inValue))remapBlock; 21 | - (LOTKeyframe *)copyWithData:(id)data; 22 | 23 | @property (nonatomic, readonly) NSNumber *keyframeTime; 24 | @property (nonatomic, readonly) BOOL isHold; 25 | @property (nonatomic, readonly) CGPoint inTangent; 26 | @property (nonatomic, readonly) CGPoint outTangent; 27 | @property (nonatomic, readonly) CGPoint spatialInTangent; 28 | @property (nonatomic, readonly) CGPoint spatialOutTangent; 29 | 30 | @property (nonatomic, readonly) CGFloat floatValue; 31 | @property (nonatomic, readonly) CGPoint pointValue; 32 | @property (nonatomic, readonly) CGSize sizeValue; 33 | @property (nonatomic, readonly) UIColor *colorValue; 34 | @property (nonatomic, readonly, nullable) LOTBezierData *pathData; 35 | @property (nonatomic, readonly) NSArray *arrayValue; 36 | 37 | @end 38 | 39 | @interface LOTKeyframeGroup : NSObject 40 | 41 | - (instancetype)initWithData:(id)data; 42 | 43 | - (void)remapKeyframesWithBlock:(CGFloat (^)(CGFloat inValue))remapBlock; 44 | 45 | @property (nonatomic, readonly) NSArray *keyframes; 46 | 47 | @end 48 | 49 | NS_ASSUME_NONNULL_END 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTLayerGroup.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTLayerGroup.m 3 | // Pods 4 | // 5 | // Created by Brandon Withrow on 2/16/17. 6 | // 7 | // 8 | 9 | #import "LOTLayerGroup.h" 10 | #import "LOTLayer.h" 11 | #import "LOTAssetGroup.h" 12 | 13 | @implementation LOTLayerGroup { 14 | NSDictionary *_modelMap; 15 | NSDictionary *_referenceIDMap; 16 | } 17 | 18 | - (instancetype)initWithLayerJSON:(NSArray *)layersJSON 19 | withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup { 20 | self = [super init]; 21 | if (self) { 22 | [self _mapFromJSON:layersJSON withAssetGroup:assetGroup]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)_mapFromJSON:(NSArray *)layersJSON withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup { 28 | 29 | NSMutableArray *layers = [NSMutableArray array]; 30 | NSMutableDictionary *modelMap = [NSMutableDictionary dictionary]; 31 | NSMutableDictionary *referenceMap = [NSMutableDictionary dictionary]; 32 | 33 | for (NSDictionary *layerJSON in layersJSON) { 34 | LOTLayer *layer = [[LOTLayer alloc] initWithJSON:layerJSON 35 | withAssetGroup:assetGroup]; 36 | [layers addObject:layer]; 37 | modelMap[layer.layerID] = layer; 38 | if (layer.referenceID) { 39 | referenceMap[layer.referenceID] = layer; 40 | } 41 | } 42 | 43 | _referenceIDMap = referenceMap; 44 | _modelMap = modelMap; 45 | _layers = layers; 46 | } 47 | 48 | - (LOTLayer *)layerModelForID:(NSNumber *)layerID { 49 | return _modelMap[layerID]; 50 | } 51 | 52 | - (LOTLayer *)layerForReferenceID:(NSString *)referenceID { 53 | return _referenceIDMap[referenceID]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTMask.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTMask.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTMask.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTMask 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 15 | self = [super init]; 16 | if (self) { 17 | [self _mapFromJSON:jsonDictionary]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 23 | NSNumber *closed = jsonDictionary[@"cl"]; 24 | _closed = closed.boolValue; 25 | 26 | NSNumber *inverted = jsonDictionary[@"inv"]; 27 | _inverted = inverted.boolValue; 28 | 29 | NSString *mode = jsonDictionary[@"mode"]; 30 | if ([mode isEqualToString:@"a"]) { 31 | _maskMode = LOTMaskModeAdd; 32 | } else if ([mode isEqualToString:@"s"]) { 33 | _maskMode = LOTMaskModeSubtract; 34 | } else if ([mode isEqualToString:@"i"]) { 35 | _maskMode = LOTMaskModeIntersect; 36 | } else { 37 | _maskMode = LOTMaskModeUnknown; 38 | } 39 | 40 | NSDictionary *maskshape = jsonDictionary[@"pt"]; 41 | if (maskshape) { 42 | _maskPath = [[LOTKeyframeGroup alloc] initWithData:maskshape]; 43 | } 44 | 45 | NSDictionary *opacity = jsonDictionary[@"o"]; 46 | if (opacity) { 47 | _opacity = [[LOTKeyframeGroup alloc] initWithData:opacity]; 48 | [_opacity remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 49 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 50 | }]; 51 | } 52 | 53 | NSDictionary *expansion = jsonDictionary[@"x"]; 54 | if (expansion) { 55 | _expansion = [[LOTKeyframeGroup alloc] initWithData:expansion]; 56 | } 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /DYLottieDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Private/LOTAnimationCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimationCache.m 3 | // Lottie 4 | // 5 | // Created by Brandon Withrow on 1/9/17. 6 | // Copyright © 2017 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimationCache.h" 10 | 11 | const NSInteger kLOTCacheSize = 50; 12 | 13 | @implementation LOTAnimationCache { 14 | NSMutableDictionary *animationsCache_; 15 | NSMutableArray *lruOrderArray_; 16 | } 17 | 18 | + (instancetype)sharedCache { 19 | static LOTAnimationCache *sharedCache = nil; 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | sharedCache = [[self alloc] init]; 23 | }); 24 | return sharedCache; 25 | } 26 | 27 | - (instancetype)init { 28 | self = [super init]; 29 | if (self) { 30 | animationsCache_ = [[NSMutableDictionary alloc] init]; 31 | lruOrderArray_ = [[NSMutableArray alloc] init]; 32 | } 33 | return self; 34 | } 35 | 36 | - (void)addAnimation:(LOTComposition *)animation forKey:(NSString *)key { 37 | if (lruOrderArray_.count >= kLOTCacheSize) { 38 | NSString *oldKey = lruOrderArray_[0]; 39 | [animationsCache_ removeObjectForKey:oldKey]; 40 | [lruOrderArray_ removeObject:oldKey]; 41 | } 42 | [lruOrderArray_ removeObject:key]; 43 | [lruOrderArray_ addObject:key]; 44 | [animationsCache_ setObject:animation forKey:key]; 45 | } 46 | 47 | - (LOTComposition *)animationForKey:(NSString *)key { 48 | if (!key) { 49 | return nil; 50 | } 51 | LOTComposition *animation = [animationsCache_ objectForKey:key]; 52 | [lruOrderArray_ removeObject:key]; 53 | [lruOrderArray_ addObject:key]; 54 | return animation; 55 | } 56 | 57 | - (void)clearCache { 58 | [animationsCache_ removeAllObjects]; 59 | [lruOrderArray_ removeAllObjects]; 60 | } 61 | 62 | - (void)removeAnimationForKey:(NSString *)key { 63 | [lruOrderArray_ removeObject:key]; 64 | [animationsCache_ removeObjectForKey:key]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeGradientFill.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeGradientFill.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/26/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeGradientFill.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTShapeGradientFill 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 15 | self = [super init]; 16 | if (self) { 17 | [self _mapFromJSON:jsonDictionary]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 23 | if (jsonDictionary[@"nm"] ) { 24 | _keyname = [jsonDictionary[@"nm"] copy]; 25 | } 26 | 27 | NSNumber *type = jsonDictionary[@"t"]; 28 | 29 | if (type.integerValue != 1) { 30 | _type = LOTGradientTypeRadial; 31 | } else { 32 | _type = LOTGradientTypeLinear; 33 | } 34 | 35 | NSDictionary *start = jsonDictionary[@"s"]; 36 | if (start) { 37 | _startPoint = [[LOTKeyframeGroup alloc] initWithData:start]; 38 | } 39 | 40 | NSDictionary *end = jsonDictionary[@"e"]; 41 | if (end) { 42 | _endPoint = [[LOTKeyframeGroup alloc] initWithData:end]; 43 | } 44 | 45 | NSDictionary *gradient = jsonDictionary[@"g"]; 46 | if (gradient) { 47 | NSDictionary *unwrappedGradient = gradient[@"k"]; 48 | _numberOfColors = gradient[@"p"]; 49 | _gradient = [[LOTKeyframeGroup alloc] initWithData:unwrappedGradient]; 50 | } 51 | 52 | NSDictionary *opacity = jsonDictionary[@"o"]; 53 | if (opacity) { 54 | _opacity = [[LOTKeyframeGroup alloc] initWithData:opacity]; 55 | [_opacity remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 56 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 57 | }]; 58 | } 59 | 60 | NSNumber *evenOdd = jsonDictionary[@"r"]; 61 | if (evenOdd.integerValue == 2) { 62 | _evenOddFillRule = YES; 63 | } else { 64 | _evenOddFillRule = NO; 65 | } 66 | } 67 | @end 68 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeStar.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeStar.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeStar.h" 10 | 11 | @implementation LOTShapeStar 12 | 13 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 14 | self = [super init]; 15 | if (self) { 16 | [self _mapFromJSON:jsonDictionary]; 17 | } 18 | return self; 19 | } 20 | 21 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 22 | 23 | if (jsonDictionary[@"nm"] ) { 24 | _keyname = [jsonDictionary[@"nm"] copy]; 25 | } 26 | 27 | NSDictionary *outerRadius = jsonDictionary[@"or"]; 28 | if (outerRadius) { 29 | _outerRadius = [[LOTKeyframeGroup alloc] initWithData:outerRadius]; 30 | } 31 | 32 | NSDictionary *outerRoundness = jsonDictionary[@"os"]; 33 | if (outerRoundness) { 34 | _outerRoundness = [[LOTKeyframeGroup alloc] initWithData:outerRoundness]; 35 | } 36 | 37 | NSDictionary *innerRadius = jsonDictionary[@"ir"]; 38 | if (innerRadius) { 39 | _innerRadius = [[LOTKeyframeGroup alloc] initWithData:innerRadius]; 40 | } 41 | 42 | NSDictionary *innerRoundness = jsonDictionary[@"is"]; 43 | if (innerRoundness) { 44 | _innerRoundness = [[LOTKeyframeGroup alloc] initWithData:innerRoundness]; 45 | } 46 | 47 | NSDictionary *position = jsonDictionary[@"p"]; 48 | if (position) { 49 | _position = [[LOTKeyframeGroup alloc] initWithData:position]; 50 | } 51 | 52 | NSDictionary *numberOfPoints = jsonDictionary[@"pt"]; 53 | if (numberOfPoints) { 54 | _numberOfPoints = [[LOTKeyframeGroup alloc] initWithData:numberOfPoints]; 55 | } 56 | 57 | NSDictionary *rotation = jsonDictionary[@"r"]; 58 | if (rotation) { 59 | _rotation = [[LOTKeyframeGroup alloc] initWithData:rotation]; 60 | } 61 | 62 | NSNumber *type = jsonDictionary[@"sy"]; 63 | _type = type.integerValue; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTTransformInterpolator.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTTransformInterpolator.h 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/18/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTNumberInterpolator.h" 11 | #import "LOTPointInterpolator.h" 12 | #import "LOTSizeInterpolator.h" 13 | #import "LOTKeyframe.h" 14 | #import "LOTLayer.h" 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface LOTTransformInterpolator : NSObject 19 | 20 | + (instancetype)transformForLayer:(LOTLayer *)layer; 21 | 22 | - (instancetype)initWithPosition:(NSArray *)position 23 | rotation:(NSArray *)rotation 24 | anchor:(NSArray *)anchor 25 | scale:(NSArray *)scale; 26 | 27 | - (instancetype)initWithPositionX:(NSArray *)positionX 28 | positionY:(NSArray *)positionY 29 | rotation:(NSArray *)rotation 30 | anchor:(NSArray *)anchor 31 | scale:(NSArray *)scale; 32 | 33 | @property (nonatomic, strong) LOTTransformInterpolator * inputNode; 34 | 35 | @property (nonatomic, readonly) LOTPointInterpolator *positionInterpolator; 36 | @property (nonatomic, readonly) LOTPointInterpolator *anchorInterpolator; 37 | @property (nonatomic, readonly) LOTSizeInterpolator *scaleInterpolator; 38 | @property (nonatomic, readonly) LOTNumberInterpolator *rotationInterpolator; 39 | @property (nonatomic, readonly) LOTNumberInterpolator *positionXInterpolator; 40 | @property (nonatomic, readonly) LOTNumberInterpolator *positionYInterpolator; 41 | 42 | - (CATransform3D)transformForFrame:(NSNumber *)frame; 43 | - (BOOL)hasUpdateForFrame:(NSNumber *)frame; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Private/LOTComposition.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTScene.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTComposition.h" 10 | #import "LOTLayer.h" 11 | #import "LOTAssetGroup.h" 12 | #import "LOTLayerGroup.h" 13 | 14 | @implementation LOTComposition 15 | 16 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary 17 | withAssetBundle:(NSBundle *)bundle { 18 | self = [super init]; 19 | if (self) { 20 | [self _mapFromJSON:jsonDictionary withAssetBundle:bundle]; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary 26 | withAssetBundle:(NSBundle *)bundle { 27 | NSNumber *width = jsonDictionary[@"w"]; 28 | NSNumber *height = jsonDictionary[@"h"]; 29 | if (width && height) { 30 | CGRect bounds = CGRectMake(0, 0, width.floatValue, height.floatValue); 31 | _compBounds = bounds; 32 | } 33 | 34 | _startFrame = [jsonDictionary[@"ip"] copy]; 35 | _endFrame = [jsonDictionary[@"op"] copy]; 36 | _framerate = [jsonDictionary[@"fr"] copy]; 37 | 38 | if (_startFrame && _endFrame && _framerate) { 39 | NSInteger frameDuration = (_endFrame.integerValue - _startFrame.integerValue) - 1; 40 | NSTimeInterval timeDuration = frameDuration / _framerate.floatValue; 41 | _timeDuration = timeDuration; 42 | } 43 | 44 | NSArray *assetArray = jsonDictionary[@"assets"]; 45 | if (assetArray.count) { 46 | _assetGroup = [[LOTAssetGroup alloc] initWithJSON:assetArray withAssetBundle:bundle]; 47 | } 48 | 49 | NSArray *layersJSON = jsonDictionary[@"layers"]; 50 | if (layersJSON) { 51 | _layerGroup = [[LOTLayerGroup alloc] initWithLayerJSON:layersJSON 52 | withAssetGroup:_assetGroup]; 53 | } 54 | 55 | [_assetGroup finalizeInitialization]; 56 | 57 | } 58 | 59 | - (void)setRootDirectory:(NSString *)rootDirectory { 60 | _rootDirectory = rootDirectory; 61 | self.assetGroup.rootDirectory = rootDirectory; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTAssetGroup.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAssetGroup.m 3 | // Pods 4 | // 5 | // Created by Brandon Withrow on 2/17/17. 6 | // 7 | // 8 | 9 | #import "LOTAssetGroup.h" 10 | #import "LOTAsset.h" 11 | 12 | @implementation LOTAssetGroup { 13 | NSMutableDictionary *_assetMap; 14 | NSDictionary *_assetJSONMap; 15 | } 16 | 17 | - (instancetype _Nonnull)initWithJSON:(NSArray * _Nonnull)jsonArray 18 | withAssetBundle:(NSBundle *_Nullable)bundle { 19 | self = [super init]; 20 | if (self) { 21 | _assetBundle = bundle; 22 | _assetMap = [NSMutableDictionary dictionary]; 23 | NSMutableDictionary *assetJSONMap = [NSMutableDictionary dictionary]; 24 | for (NSDictionary *assetDictionary in jsonArray) { 25 | NSString *referenceID = assetDictionary[@"id"]; 26 | if (referenceID) { 27 | assetJSONMap[referenceID] = assetDictionary; 28 | } 29 | } 30 | _assetJSONMap = assetJSONMap; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)buildAssetNamed:(NSString *)refID { 36 | 37 | if ([self assetModelForID:refID]) { 38 | return; 39 | } 40 | 41 | NSDictionary *assetDictionary = _assetJSONMap[refID]; 42 | if (assetDictionary) { 43 | LOTAsset *asset = [[LOTAsset alloc] initWithJSON:assetDictionary 44 | withAssetGroup:self 45 | withAssetBundle:_assetBundle]; 46 | _assetMap[refID] = asset; 47 | } 48 | } 49 | 50 | - (void)finalizeInitialization { 51 | for (NSString *refID in _assetJSONMap.allKeys) { 52 | [self buildAssetNamed:refID]; 53 | } 54 | _assetJSONMap = nil; 55 | } 56 | 57 | - (LOTAsset *)assetModelForID:(NSString *)assetID { 58 | return _assetMap[assetID]; 59 | } 60 | - (void)setRootDirectory:(NSString *)rootDirectory{ 61 | _rootDirectory = rootDirectory; 62 | [_assetMap enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, LOTAsset * _Nonnull obj, BOOL * _Nonnull stop) { 63 | obj.rootDirectory = rootDirectory; 64 | }]; 65 | } 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeStroke.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeStroke.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeStroke.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTShapeStroke 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 15 | self = [super init]; 16 | if (self) { 17 | [self _mapFromJSON:jsonDictionary]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 23 | 24 | if (jsonDictionary[@"nm"] ) { 25 | _keyname = [jsonDictionary[@"nm"] copy]; 26 | } 27 | 28 | NSDictionary *color = jsonDictionary[@"c"]; 29 | if (color) { 30 | _color = [[LOTKeyframeGroup alloc] initWithData:color]; 31 | } 32 | 33 | NSDictionary *width = jsonDictionary[@"w"]; 34 | if (width) { 35 | _width = [[LOTKeyframeGroup alloc] initWithData:width]; 36 | } 37 | 38 | NSDictionary *opacity = jsonDictionary[@"o"]; 39 | if (opacity) { 40 | _opacity = [[LOTKeyframeGroup alloc] initWithData:opacity]; 41 | [_opacity remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 42 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 43 | }]; 44 | } 45 | 46 | _capType = [jsonDictionary[@"lc"] integerValue] - 1; 47 | _joinType = [jsonDictionary[@"lj"] integerValue] - 1; 48 | 49 | NSNumber *fillEnabled = jsonDictionary[@"fillEnabled"]; 50 | _fillEnabled = fillEnabled.boolValue; 51 | 52 | NSDictionary *dashOffset = nil; 53 | NSArray *dashes = jsonDictionary[@"d"]; 54 | if (dashes) { 55 | NSMutableArray *dashPattern = [NSMutableArray array]; 56 | for (NSDictionary *dash in dashes) { 57 | if ([dash[@"n"] isEqualToString:@"o"]) { 58 | dashOffset = dash[@"v"]; 59 | continue; 60 | } 61 | // TODO DASH PATTERNS 62 | NSDictionary *value = dash[@"v"]; 63 | LOTKeyframeGroup *keyframeGroup = [[LOTKeyframeGroup alloc] initWithData:value]; 64 | [dashPattern addObject:keyframeGroup]; 65 | } 66 | _lineDashPattern = dashPattern; 67 | } 68 | if (dashOffset) { 69 | _dashOffset = [[LOTKeyframeGroup alloc] initWithData:dashOffset]; 70 | } 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/yaolongkang.xcuserdatad/xcschemes/lottie-ios.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/yaolongkang.xcuserdatad/xcschemes/Pods-DYLottieDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTFillRenderer.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTFillRenderer.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTFillRenderer.h" 10 | #import "LOTColorInterpolator.h" 11 | #import "LOTNumberInterpolator.h" 12 | #import "LOTHelpers.h" 13 | 14 | @implementation LOTFillRenderer { 15 | LOTColorInterpolator *colorInterpolator_; 16 | LOTNumberInterpolator *opacityInterpolator_; 17 | BOOL _evenOddFillRule; 18 | CALayer *centerPoint_DEBUG; 19 | } 20 | 21 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nonnull)inputNode 22 | shapeFill:(LOTShapeFill *_Nonnull)fill { 23 | self = [super initWithInputNode:inputNode keyName:fill.keyname]; 24 | if (self) { 25 | colorInterpolator_ = [[LOTColorInterpolator alloc] initWithKeyframes:fill.color.keyframes]; 26 | opacityInterpolator_ = [[LOTNumberInterpolator alloc] initWithKeyframes:fill.opacity.keyframes]; 27 | centerPoint_DEBUG = [CALayer layer]; 28 | centerPoint_DEBUG.bounds = CGRectMake(0, 0, 20, 20); 29 | if (ENABLE_DEBUG_SHAPES) { 30 | [self.outputLayer addSublayer:centerPoint_DEBUG]; 31 | } 32 | _evenOddFillRule = fill.evenOddFillRule; 33 | 34 | self.outputLayer.fillRule = _evenOddFillRule ? @"even-odd" : @"non-zero"; 35 | } 36 | return self; 37 | } 38 | 39 | - (NSDictionary *)valueInterpolators { 40 | return @{@"Color" : colorInterpolator_, 41 | @"Opacity" : opacityInterpolator_}; 42 | } 43 | 44 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 45 | return [colorInterpolator_ hasUpdateForFrame:frame] || [opacityInterpolator_ hasUpdateForFrame:frame]; 46 | } 47 | 48 | - (void)performLocalUpdate { 49 | centerPoint_DEBUG.backgroundColor = [colorInterpolator_ colorForFrame:self.currentFrame].CGColor; 50 | centerPoint_DEBUG.borderColor = [UIColor lightGrayColor].CGColor; 51 | centerPoint_DEBUG.borderWidth = 2.f; 52 | self.outputLayer.fillColor = [colorInterpolator_ colorForFrame:self.currentFrame].CGColor; 53 | self.outputLayer.opacity = [opacityInterpolator_ floatValueForFrame:self.currentFrame]; 54 | } 55 | 56 | - (void)rebuildOutputs { 57 | self.outputLayer.path = self.inputNode.outputPath.CGPath; 58 | } 59 | 60 | - (NSDictionary *)actionsForRenderLayer { 61 | return @{@"backgroundColor": [NSNull null], 62 | @"fillColor": [NSNull null], 63 | @"opacity" : [NSNull null]}; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /DYLottieDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DYLottieDemo 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DYAnimationVC.h" 11 | 12 | @interface ViewController () 13 | 14 | @property(nonatomic,strong)UITableView *tableView; 15 | @property(nonatomic,strong)NSArray *titleArr; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | -(UITableView *)tableView{ 21 | if (!_tableView) { 22 | _tableView = [[UITableView alloc]initWithFrame:self.view.bounds]; 23 | _tableView.dataSource = self; 24 | _tableView.delegate = self; 25 | _tableView.tableFooterView = [[UIView alloc]init]; 26 | _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; 27 | } 28 | return _tableView; 29 | } 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view, typically from a nib. 33 | 34 | self.titleArr = [NSArray arrayWithObjects:@"Animation - Ⅰ",@"Animation - Ⅱ",@"Animation - Ⅲ",@"Animation - Ⅳ",@"Animation - Ⅴ",@"Animation - Ⅵ",@"Animation - Ⅶ",@"Animation - Ⅷ",@"Animation - Ⅸ",@"Animation - Ⅹ", nil]; 35 | [self.view addSubview:self.tableView]; 36 | 37 | } 38 | 39 | #pragma mark - UITableViewDataSource/UITableViewDelegate 40 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 41 | return 10; 42 | } 43 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 44 | NSString *identify = @"CellID"; 45 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify]; 46 | if (!cell) { 47 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identify]; 48 | } 49 | cell.textLabel.text = self.titleArr[indexPath.row]; 50 | 51 | return cell; 52 | } 53 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 54 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 55 | DYAnimationVC *animationVC = [[DYAnimationVC alloc]initWithAnimationType:indexPath.row+1]; 56 | [self presentViewController:animationVC animated:YES completion:NULL]; 57 | } 58 | - (void)didReceiveMemoryWarning { 59 | [super didReceiveMemoryWarning]; 60 | // Dispose of any resources that can be recreated. 61 | } 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTPathInterpolator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPathInterpolator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/13/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTPathInterpolator.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTPathInterpolator 13 | 14 | - (LOTBezierPath *)pathForFrame:(NSNumber *)frame cacheLengths:(BOOL)cacheLengths { 15 | CGFloat progress = [self progressForFrame:frame]; 16 | 17 | LOTBezierPath *returnPath = [[LOTBezierPath alloc] init]; 18 | returnPath.cacheLengths = cacheLengths; 19 | LOTBezierData *leadingData = self.leadingKeyframe.pathData; 20 | LOTBezierData *trailingData = self.trailingKeyframe.pathData; 21 | NSInteger vertexCount = leadingData ? leadingData.count : trailingData.count; 22 | BOOL closePath = leadingData ? leadingData.closed : trailingData.closed; 23 | CGPoint cp1 = CGPointMake(0, 0); 24 | CGPoint cp2, p1, cp3 = CGPointZero; 25 | CGPoint startPoint = CGPointMake(0, 0); 26 | CGPoint startInTangent = CGPointMake(0, 0); 27 | for (int i = 0; i < vertexCount; i++) { 28 | if (progress == 0) { 29 | cp2 = [leadingData inTangentAtIndex:i]; 30 | p1 = [leadingData vertexAtIndex:i]; 31 | cp3 = [leadingData outTangentAtIndex:i]; 32 | } else if (progress == 1) { 33 | cp2 = [trailingData inTangentAtIndex:i]; 34 | p1 = [trailingData vertexAtIndex:i]; 35 | cp3 = [trailingData outTangentAtIndex:i]; 36 | } else { 37 | cp2 = LOT_PointInLine([leadingData inTangentAtIndex:i], 38 | [trailingData inTangentAtIndex:i], 39 | progress); 40 | p1 = LOT_PointInLine([leadingData vertexAtIndex:i], 41 | [trailingData vertexAtIndex:i], 42 | progress); 43 | cp3 = LOT_PointInLine([leadingData outTangentAtIndex:i], 44 | [trailingData outTangentAtIndex:i], 45 | progress); 46 | } 47 | if (i == 0) { 48 | startPoint = p1; 49 | startInTangent = cp2; 50 | [returnPath LOT_moveToPoint:p1]; 51 | } else { 52 | [returnPath LOT_addCurveToPoint:p1 controlPoint1:cp1 controlPoint2:cp2]; 53 | } 54 | cp1 = cp3; 55 | } 56 | 57 | if (closePath) { 58 | [returnPath LOT_addCurveToPoint:startPoint controlPoint1:cp3 controlPoint2:startInTangent]; 59 | [returnPath LOT_closePath]; 60 | } 61 | 62 | return returnPath; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTLayer.h 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LOTPlatformCompat.h" 11 | #import "LOTKeyframe.h" 12 | 13 | @class LOTShapeGroup; 14 | @class LOTMask; 15 | @class LOTAsset; 16 | @class LOTAssetGroup; 17 | 18 | typedef enum : NSInteger { 19 | LOTLayerTypePrecomp, 20 | LOTLayerTypeSolid, 21 | LOTLayerTypeImage, 22 | LOTLayerTypeNull, 23 | LOTLayerTypeShape, 24 | LOTLayerTypeUnknown 25 | } LOTLayerType; 26 | 27 | typedef enum : NSInteger { 28 | LOTMatteTypeNone, 29 | LOTMatteTypeAdd, 30 | LOTMatteTypeInvert, 31 | LOTMatteTypeUnknown 32 | } LOTMatteType; 33 | 34 | NS_ASSUME_NONNULL_BEGIN 35 | 36 | @interface LOTLayer : NSObject 37 | 38 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary 39 | withAssetGroup:(LOTAssetGroup * _Nullable)assetGroup; 40 | 41 | @property (nonatomic, readonly) NSString *layerName; 42 | @property (nonatomic, readonly, nullable) NSString *referenceID; 43 | @property (nonatomic, readonly) NSNumber *layerID; 44 | @property (nonatomic, readonly) LOTLayerType layerType; 45 | @property (nonatomic, readonly, nullable) NSNumber *parentID; 46 | @property (nonatomic, readonly) NSNumber *startFrame; 47 | @property (nonatomic, readonly) NSNumber *inFrame; 48 | @property (nonatomic, readonly) NSNumber *outFrame; 49 | @property (nonatomic, readonly) CGRect layerBounds; 50 | 51 | @property (nonatomic, readonly, nullable) NSArray *shapes; 52 | @property (nonatomic, readonly, nullable) NSArray *masks; 53 | 54 | @property (nonatomic, readonly, nullable) NSNumber *layerWidth; 55 | @property (nonatomic, readonly, nullable) NSNumber *layerHeight; 56 | @property (nonatomic, readonly, nullable) UIColor *solidColor; 57 | @property (nonatomic, readonly, nullable) LOTAsset *imageAsset; 58 | 59 | @property (nonatomic, readonly) LOTKeyframeGroup *opacity; 60 | @property (nonatomic, readonly) LOTKeyframeGroup *rotation; 61 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *position; 62 | 63 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *positionX; 64 | @property (nonatomic, readonly, nullable) LOTKeyframeGroup *positionY; 65 | 66 | @property (nonatomic, readonly) LOTKeyframeGroup *anchor; 67 | @property (nonatomic, readonly) LOTKeyframeGroup *scale; 68 | 69 | @property (nonatomic, readonly) LOTMatteType matteType; 70 | 71 | @end 72 | 73 | NS_ASSUME_NONNULL_END 74 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeRepeater.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeRepeater.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/28/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeRepeater.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTShapeRepeater 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 15 | self = [super init]; 16 | if (self) { 17 | [self _mapFromJSON:jsonDictionary]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 23 | 24 | if (jsonDictionary[@"nm"] ) { 25 | _keyname = [jsonDictionary[@"nm"] copy]; 26 | } 27 | 28 | NSDictionary *copies = jsonDictionary[@"c"]; 29 | if (copies) { 30 | _copies = [[LOTKeyframeGroup alloc] initWithData:copies]; 31 | } 32 | 33 | NSDictionary *offset = jsonDictionary[@"o"]; 34 | if (offset) { 35 | _offset = [[LOTKeyframeGroup alloc] initWithData:offset]; 36 | } 37 | 38 | NSDictionary *transform = jsonDictionary[@"tr"]; 39 | 40 | NSDictionary *rotation = transform[@"r"]; 41 | if (rotation) { 42 | _rotation = [[LOTKeyframeGroup alloc] initWithData:rotation]; 43 | [_rotation remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 44 | return LOT_DegreesToRadians(inValue); 45 | }]; 46 | } 47 | 48 | NSDictionary *startOpacity = transform[@"so"]; 49 | if (startOpacity) { 50 | _startOpacity = [[LOTKeyframeGroup alloc] initWithData:startOpacity]; 51 | [_startOpacity remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 52 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 53 | }]; 54 | } 55 | 56 | NSDictionary *endOpacity = transform[@"eo"]; 57 | if (endOpacity) { 58 | _endOpacity = [[LOTKeyframeGroup alloc] initWithData:endOpacity]; 59 | [_endOpacity remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 60 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 61 | }]; 62 | } 63 | 64 | NSDictionary *anchorPoint = transform[@"a"]; 65 | if (anchorPoint) { 66 | _anchorPoint = [[LOTKeyframeGroup alloc] initWithData:anchorPoint]; 67 | } 68 | 69 | NSDictionary *position = transform[@"p"]; 70 | if (position) { 71 | _position = [[LOTKeyframeGroup alloc] initWithData:position]; 72 | } 73 | 74 | NSDictionary *scale = transform[@"s"]; 75 | if (scale) { 76 | _scale = [[LOTKeyframeGroup alloc] initWithData:scale]; 77 | [_scale remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 78 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 79 | }]; 80 | } 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Extensions/UIColor+Expanded.h: -------------------------------------------------------------------------------- 1 | #import "LOTPlatformCompat.h" 2 | 3 | // From http://github.com/ars/uicolor-utilities 4 | #define CLAMP(val,min,max) MIN(MAX(val,min),max) 5 | 6 | @interface UIColor (UIColor_Expanded) 7 | @property (nonatomic, readonly) CGColorSpaceModel colorSpaceModel; 8 | @property (nonatomic, readonly) BOOL canProvideRGBComponents; 9 | @property (nonatomic, readonly) CGFloat red; // Only valid if canProvideRGBComponents is YES 10 | @property (nonatomic, readonly) CGFloat green; // Only valid if canProvideRGBComponents is YES 11 | @property (nonatomic, readonly) CGFloat blue; // Only valid if canProvideRGBComponents is YES 12 | @property (nonatomic, readonly) CGFloat white; // Only valid if colorSpaceModel == kCGColorSpaceModelMonochrome 13 | @property (nonatomic, readonly) CGFloat alpha; 14 | @property (nonatomic, readonly) UInt32 rgbHex; 15 | 16 | - (NSString *)LOT_colorSpaceString; 17 | 18 | - (NSArray *)LOT_arrayFromRGBAComponents; 19 | 20 | - (BOOL)LOT_red:(CGFloat *)r green:(CGFloat *)g blue:(CGFloat *)b alpha:(CGFloat *)a; 21 | 22 | - (UIColor *)LOT_colorByLuminanceMapping; 23 | 24 | - (UIColor *)LOT_colorByMultiplyingByRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 25 | - (UIColor *) LOT_colorByAddingRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 26 | - (UIColor *) LOT_colorByLighteningToRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 27 | - (UIColor *) LOT_colorByDarkeningToRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 28 | 29 | - (UIColor *)LOT_colorByMultiplyingBy:(CGFloat)f; 30 | - (UIColor *) LOT_colorByAdding:(CGFloat)f; 31 | - (UIColor *) LOT_colorByLighteningTo:(CGFloat)f; 32 | - (UIColor *) LOT_colorByDarkeningTo:(CGFloat)f; 33 | 34 | - (UIColor *)LOT_colorByMultiplyingByColor:(UIColor *)color; 35 | - (UIColor *) LOT_colorByAddingColor:(UIColor *)color; 36 | - (UIColor *) LOT_colorByLighteningToColor:(UIColor *)color; 37 | - (UIColor *) LOT_colorByDarkeningToColor:(UIColor *)color; 38 | 39 | - (NSString *)LOT_stringFromColor; 40 | - (NSString *)LOT_hexStringValue; 41 | 42 | + (UIColor *)LOT_randomColor; 43 | + (UIColor *)LOT_colorWithString:(NSString *)stringToConvert; 44 | + (UIColor *)LOT_colorWithRGBHex:(UInt32)hex; 45 | + (UIColor *)LOT_colorWithHexString:(NSString *)stringToConvert; 46 | 47 | + (UIColor *)LOT_colorWithName:(NSString *)cssColorName; 48 | 49 | + (UIColor *)LOT_colorByLerpingFromColor:(UIColor *)fromColor toColor:(UIColor *)toColor amount:(CGFloat)amount; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeTransform.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShapeTransform.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/15/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeTransform.h" 10 | #import "LOTHelpers.h" 11 | 12 | @implementation LOTShapeTransform 13 | 14 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 15 | self = [super init]; 16 | if (self) { 17 | [self _mapFromJSON:jsonDictionary]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 23 | 24 | if (jsonDictionary[@"nm"] ) { 25 | _keyname = [jsonDictionary[@"nm"] copy]; 26 | } 27 | 28 | NSDictionary *position = jsonDictionary[@"p"]; 29 | if (position) { 30 | _position = [[LOTKeyframeGroup alloc] initWithData:position]; 31 | } 32 | 33 | NSDictionary *anchor = jsonDictionary[@"a"]; 34 | if (anchor) { 35 | _anchor = [[LOTKeyframeGroup alloc] initWithData:anchor]; 36 | } 37 | 38 | NSDictionary *scale = jsonDictionary[@"s"]; 39 | if (scale) { 40 | _scale = [[LOTKeyframeGroup alloc] initWithData:scale]; 41 | [_scale remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 42 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 43 | }]; 44 | } 45 | 46 | NSDictionary *rotation = jsonDictionary[@"r"]; 47 | if (rotation) { 48 | _rotation = [[LOTKeyframeGroup alloc] initWithData:rotation]; 49 | [_rotation remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 50 | return LOT_DegreesToRadians(inValue); 51 | }]; 52 | } 53 | 54 | NSDictionary *opacity = jsonDictionary[@"o"]; 55 | if (opacity) { 56 | _opacity = [[LOTKeyframeGroup alloc] initWithData:opacity]; 57 | [_opacity remapKeyframesWithBlock:^CGFloat(CGFloat inValue) { 58 | return LOT_RemapValue(inValue, 0, 100, 0, 1); 59 | }]; 60 | } 61 | 62 | NSString *name = jsonDictionary[@"nm"]; 63 | 64 | NSDictionary *skew = jsonDictionary[@"sk"]; 65 | BOOL hasSkew = (skew && [skew[@"k"] isEqual:@0] == NO); 66 | NSDictionary *skewAxis = jsonDictionary[@"sa"]; 67 | BOOL hasSkewAxis = (skewAxis && [skewAxis[@"k"] isEqual:@0] == NO); 68 | 69 | if (hasSkew || hasSkewAxis) { 70 | NSLog(@"%s: Warning: skew is not supported: %@", __PRETTY_FUNCTION__, name); 71 | } 72 | 73 | } 74 | 75 | - (NSString *)description { 76 | return [NSString stringWithFormat:@"LOTShapeTransform \"Position: %@ Anchor: %@ Scale: %@ Rotation: %@ Opacity: %@\"", _position.description, _anchor.description, _scale.description, _rotation.description, _opacity.description]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /DYLottieDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DYLottieDemo 4 | // 5 | // Created by DanielYK on 2017/8/22. 6 | // Copyright © 2017年 DanielYK. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | self.window.backgroundColor = [UIColor whiteColor]; 23 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:[ViewController new]]; 24 | self.window.rootViewController = nav; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application { 31 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 32 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 33 | } 34 | 35 | 36 | - (void)applicationDidEnterBackground:(UIApplication *)application { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | 42 | - (void)applicationWillEnterForeground:(UIApplication *)application { 43 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 44 | } 45 | 46 | 47 | - (void)applicationDidBecomeActive:(UIApplication *)application { 48 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 49 | } 50 | 51 | 52 | - (void)applicationWillTerminate:(UIApplication *)application { 53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/LOTAnimatorNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimatorNode.h 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // 7 | // 8 | 9 | #import 10 | #import "LOTPlatformCompat.h" 11 | #import "LOTBezierPath.h" 12 | 13 | extern NSInteger indentation_level; 14 | @interface LOTAnimatorNode : NSObject 15 | 16 | /// Initializes the node with and optional intput node and keyname. 17 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 18 | keyName:(NSString *_Nullable)keyname; 19 | 20 | /// A dictionary of the value interpolators this node controls 21 | @property (nonatomic, readonly, strong) NSDictionary * _Nullable valueInterpolators; 22 | 23 | /// The keyname of the node. Used for dynamically setting keyframe data. 24 | @property (nonatomic, readonly, strong) NSString * _Nullable keyname; 25 | 26 | /// The current time in frames 27 | @property (nonatomic, readonly, strong) NSNumber * _Nullable currentFrame; 28 | /// The upstream animator node 29 | @property (nonatomic, readonly, strong) LOTAnimatorNode * _Nullable inputNode; 30 | 31 | /// This nodes path in local object space 32 | @property (nonatomic, strong) LOTBezierPath * _Nonnull localPath; 33 | /// The sum of all paths in the tree including this node 34 | @property (nonatomic, strong) LOTBezierPath * _Nonnull outputPath; 35 | 36 | /// Returns true if this node needs to update its contents for the given frame. To be overwritten by subclasses. 37 | - (BOOL)needsUpdateForFrame:(NSNumber *_Nonnull)frame; 38 | 39 | /// Sets the current frame and performs any updates. Returns true if any updates were performed, locally or upstream. 40 | - (BOOL)updateWithFrame:(NSNumber *_Nonnull)frame; 41 | - (BOOL)updateWithFrame:(NSNumber *_Nonnull)frame 42 | withModifierBlock:(void (^_Nullable)(LOTAnimatorNode * _Nonnull inputNode))modifier 43 | forceLocalUpdate:(BOOL)forceUpdate; 44 | 45 | - (void)forceSetCurrentFrame:(NSNumber *_Nonnull)frame; 46 | 47 | @property (nonatomic, assign) BOOL pathShouldCacheLengths; 48 | /// Update the local content for the frame. 49 | - (void)performLocalUpdate; 50 | 51 | /// Rebuild all outputs for the node. This is called after upstream updates have been performed. 52 | - (void)rebuildOutputs; 53 | 54 | /// Traverses children untill keypath is found and attempts to set the keypath to the value. 55 | - (BOOL)setValue:(nonnull id)value 56 | forKeyAtPath:(nonnull NSString *)keypath 57 | forFrame:(nullable NSNumber *)frame; 58 | 59 | /// Sets the keyframe to the value, to be overwritten by subclasses 60 | - (BOOL)setInterpolatorValue:(nonnull id)value 61 | forKey:(nonnull NSString *)key 62 | forFrame:(nullable NSNumber *)frame; 63 | 64 | - (void)logString:(NSString *_Nonnull)string; 65 | 66 | - (void)logHierarchyKeypathsWithParent:(NSString * _Nullable)parent; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /DYLottieDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Extensions/LOTRadialGradientLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimationView 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTRadialGradientLayer.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTRadialGradientLayer 13 | 14 | @dynamic isRadial; 15 | @dynamic startPoint; 16 | @dynamic endPoint; 17 | @dynamic colors; 18 | @dynamic locations; 19 | 20 | + (BOOL)needsDisplayForKey:(NSString *)key { 21 | if ([key isEqualToString:@"startPoint"] || 22 | [key isEqualToString:@"endPoint"] || 23 | [key isEqualToString:@"colors"] || 24 | [key isEqualToString:@"locations"] || 25 | [key isEqualToString:@"isRadial"]) { 26 | return YES; 27 | } 28 | return [super needsDisplayForKey:key]; 29 | } 30 | 31 | - (id)actionForKey:(NSString *)key { 32 | if (self.actions[key]) { 33 | return self.actions[key]; 34 | } 35 | 36 | if ([key isEqualToString:@"startPoint"] || 37 | [key isEqualToString:@"endPoint"] || 38 | [key isEqualToString:@"colors"] || 39 | [key isEqualToString:@"locations"] || 40 | [key isEqualToString:@"isRadial"]) { 41 | CABasicAnimation *theAnimation = [CABasicAnimation animationWithKeyPath:key]; 42 | theAnimation.fromValue = [self.presentationLayer valueForKey:key]; 43 | return theAnimation; 44 | } 45 | return [super actionForKey:key]; 46 | } 47 | 48 | - (void)drawInContext:(CGContextRef)ctx { 49 | NSInteger numberOfLocations = self.locations.count; 50 | NSInteger numbOfComponents = 0; 51 | CGColorSpaceRef colorSpace = NULL; 52 | 53 | if (self.colors.count) { 54 | CGColorRef colorRef = (__bridge CGColorRef)[self.colors objectAtIndex:0]; 55 | numbOfComponents = CGColorGetNumberOfComponents(colorRef); 56 | colorSpace = CGColorGetColorSpace(colorRef); 57 | } 58 | 59 | CGPoint origin = self.startPoint; 60 | CGFloat radius = LOT_PointDistanceFromPoint(self.startPoint, self.endPoint); 61 | 62 | CGFloat gradientLocations[numberOfLocations]; 63 | CGFloat gradientComponents[numberOfLocations * numbOfComponents]; 64 | 65 | for (NSInteger locationIndex = 0; locationIndex < numberOfLocations; locationIndex++) { 66 | 67 | gradientLocations[locationIndex] = [self.locations[locationIndex] floatValue]; 68 | const CGFloat *colorComponents = CGColorGetComponents((__bridge CGColorRef)self.colors[locationIndex]); 69 | 70 | for (NSInteger componentIndex = 0; componentIndex < numbOfComponents; componentIndex++) { 71 | gradientComponents[numbOfComponents * locationIndex + componentIndex] = colorComponents[componentIndex]; 72 | } 73 | } 74 | 75 | CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, gradientComponents, gradientLocations, numberOfLocations); 76 | 77 | if (self.isRadial) { 78 | CGContextDrawRadialGradient(ctx, gradient, origin, 0, origin, radius, kCGGradientDrawsAfterEndLocation); 79 | } else { 80 | CGContextDrawLinearGradient(ctx, gradient, self.startPoint, self.endPoint, kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation); 81 | } 82 | 83 | CGGradientRelease(gradient); 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTCircleAnimator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTCircleAnimator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/19/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTCircleAnimator.h" 10 | #import "LOTPointInterpolator.h" 11 | 12 | const CGFloat kLOTEllipseControlPointPercentage = 0.55228; 13 | 14 | @implementation LOTCircleAnimator { 15 | LOTPointInterpolator *_centerInterpolator; 16 | LOTPointInterpolator *_sizeInterpolator; 17 | BOOL _reversed; 18 | } 19 | 20 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 21 | shapeCircle:(LOTShapeCircle *_Nonnull)shapeCircle { 22 | self = [super initWithInputNode:inputNode keyName:shapeCircle.keyname]; 23 | if (self) { 24 | _centerInterpolator = [[LOTPointInterpolator alloc] initWithKeyframes:shapeCircle.position.keyframes]; 25 | _sizeInterpolator = [[LOTPointInterpolator alloc] initWithKeyframes:shapeCircle.size.keyframes]; 26 | _reversed = shapeCircle.reversed; 27 | } 28 | return self; 29 | } 30 | 31 | - (NSDictionary *)valueInterpolators { 32 | return @{@"Size" : _sizeInterpolator, 33 | @"Position" : _centerInterpolator}; 34 | } 35 | 36 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 37 | return [_centerInterpolator hasUpdateForFrame:frame] || [_sizeInterpolator hasUpdateForFrame:frame]; 38 | } 39 | 40 | - (void)performLocalUpdate { 41 | // Unfortunately we HAVE to manually build out the ellipse. 42 | // Every Apple method constructs from the 3 o-clock position 43 | // After effects contrsucts from the Noon position. 44 | // After effects does clockwise, but also has a flag for reversed. 45 | CGPoint center = [_centerInterpolator pointValueForFrame:self.currentFrame]; 46 | CGPoint size = [_sizeInterpolator pointValueForFrame:self.currentFrame]; 47 | 48 | CGFloat halfWidth = size.x / 2; 49 | CGFloat halfHeight = size.y / 2; 50 | 51 | if (_reversed) { 52 | halfWidth = halfWidth * -1; 53 | } 54 | 55 | CGPoint circleQ1 = CGPointMake(center.x, center.y - halfHeight); 56 | CGPoint circleQ2 = CGPointMake(center.x + halfWidth, center.y); 57 | CGPoint circleQ3 = CGPointMake(center.x, center.y + halfHeight); 58 | CGPoint circleQ4 = CGPointMake(center.x - halfWidth, center.y); 59 | 60 | CGFloat cpW = halfWidth * kLOTEllipseControlPointPercentage; 61 | CGFloat cpH = halfHeight * kLOTEllipseControlPointPercentage; 62 | 63 | LOTBezierPath *path = [[LOTBezierPath alloc] init]; 64 | path.cacheLengths = self.pathShouldCacheLengths; 65 | [path LOT_moveToPoint:circleQ1]; 66 | [path LOT_addCurveToPoint:circleQ2 controlPoint1:CGPointMake(circleQ1.x + cpW, circleQ1.y) controlPoint2:CGPointMake(circleQ2.x, circleQ2.y - cpH)]; 67 | 68 | [path LOT_addCurveToPoint:circleQ3 controlPoint1:CGPointMake(circleQ2.x, circleQ2.y + cpH) controlPoint2:CGPointMake(circleQ3.x + cpW, circleQ3.y)]; 69 | 70 | [path LOT_addCurveToPoint:circleQ4 controlPoint1:CGPointMake(circleQ3.x - cpW, circleQ3.y) controlPoint2:CGPointMake(circleQ4.x, circleQ4.y + cpH)]; 71 | 72 | [path LOT_addCurveToPoint:circleQ1 controlPoint1:CGPointMake(circleQ4.x, circleQ4.y - cpH) controlPoint2:CGPointMake(circleQ1.x - cpW, circleQ1.y)]; 73 | 74 | self.localPath = path; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/AnimatableProperties/LOTBezierData.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTBezierData.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/10/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTBezierData.h" 10 | #import "CGGeometry+LOTAdditions.h" 11 | 12 | @implementation LOTBezierData { 13 | CGPoint *_vertices; 14 | CGPoint *_inTangents; 15 | CGPoint *_outTangents; 16 | } 17 | 18 | - (instancetype)initWithData:(NSDictionary *)bezierData 19 | { 20 | self = [super init]; 21 | if (self) { 22 | [self initializeData:bezierData]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)dealloc { 28 | free(_vertices); 29 | free(_inTangents); 30 | free(_outTangents); 31 | } 32 | 33 | - (CGPoint)vertexAtIndex:(NSInteger)index { 34 | NSAssert((index < _count && 35 | index >= 0), 36 | @"Lottie: Index out of bounds"); 37 | return _vertices[index]; 38 | } 39 | 40 | - (CGPoint)inTangentAtIndex:(NSInteger)index { 41 | NSAssert((index < _count && 42 | index >= 0), 43 | @"Lottie: Index out of bounds"); 44 | return _inTangents[index]; 45 | } 46 | 47 | - (CGPoint)outTangentAtIndex:(NSInteger)index { 48 | NSAssert((index < _count && 49 | index >= 0), 50 | @"Lottie: Index out of bounds"); 51 | return _outTangents[index]; 52 | } 53 | 54 | - (void)initializeData:(NSDictionary *)bezierData { 55 | 56 | NSArray *pointsArray = bezierData[@"v"]; 57 | NSArray *inTangents = bezierData[@"i"]; 58 | NSArray *outTangents = bezierData[@"o"]; 59 | 60 | if (pointsArray.count == 0) { 61 | NSLog(@"%s: Warning: shape has no vertices", __PRETTY_FUNCTION__); 62 | return ; 63 | } 64 | 65 | NSAssert((pointsArray.count == inTangents.count && 66 | pointsArray.count == outTangents.count), 67 | @"Lottie: Incorrect number of points and tangents"); 68 | _count = pointsArray.count; 69 | _vertices = (CGPoint *)malloc(sizeof(CGPoint) * pointsArray.count); 70 | _inTangents = (CGPoint *)malloc(sizeof(CGPoint) * pointsArray.count); 71 | _outTangents = (CGPoint *)malloc(sizeof(CGPoint) * pointsArray.count); 72 | if (bezierData[@"c"]) { 73 | _closed = [bezierData[@"c"] boolValue]; 74 | } 75 | for (int i = 0; i < pointsArray.count; i ++) { 76 | CGPoint vertex = [self _vertexAtIndex:i inArray:pointsArray]; 77 | CGPoint outTan = LOT_PointAddedToPoint(vertex, [self _vertexAtIndex:i inArray:outTangents]); 78 | CGPoint inTan = LOT_PointAddedToPoint(vertex, [self _vertexAtIndex:i inArray:inTangents]); 79 | // BW BUG Straight Lines - Test Later 80 | // Bake fix for lines here 81 | _vertices[i] = vertex; 82 | _inTangents[i] = inTan; 83 | _outTangents[i] = outTan; 84 | } 85 | } 86 | 87 | - (CGPoint)_vertexAtIndex:(NSInteger)idx inArray:(NSArray *)points { 88 | NSAssert((idx < points.count), 89 | @"Lottie: Vertex Point out of bounds"); 90 | 91 | NSArray *pointArray = points[idx]; 92 | 93 | NSAssert((pointArray.count >= 2 && 94 | [pointArray.firstObject isKindOfClass:[NSNumber class]]), 95 | @"Lottie: Point Data Malformed"); 96 | 97 | return CGPointMake([(NSNumber *)pointArray[0] floatValue], [(NSNumber *)pointArray[1] floatValue]); 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/PublicHeaders/LOTAnimationTransitionController.h: -------------------------------------------------------------------------------- 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 | 9 | #import 10 | #import 11 | 12 | /** LOTAnimationTransitionController 13 | * 14 | * This class creates a custom UIViewController transisiton animation 15 | * using a Lottie animation to transition between two view controllers 16 | * The transition can use custom defined layers in After Effects for to/from 17 | * 18 | * When referencing After Effects layers the animator masks or transforms the to/from viewController 19 | * with the referenced layer. 20 | * 21 | */ 22 | 23 | @interface LOTAnimationTransitionController : NSObject 24 | 25 | /** 26 | The initializer to create a new transition animation. 27 | 28 | @param animation The name of the Lottie Animation to load for the transition 29 | 30 | @param fromLayer The name of the custom layer to mask the fromVC screenshot with. 31 | If no layer is specified then the screenshot is added behind the Lottie Animation 32 | 33 | @param toLayer The name of the custom layer to mask the toVC screenshot with. 34 | If no layer is specified then the screenshot is added behind the Lottie Animation 35 | and a fade transition is performed along with the Lottie animation. 36 | 37 | @param applyAnimationTransform A boolean that determines if the custom layer should 38 | have the transform animation from the After Effects layer applied to it. If NO the 39 | layer will be masked by the After Effects Layer 40 | 41 | */ 42 | - (nonnull instancetype)initWithAnimationNamed:(nonnull NSString *)animation 43 | fromLayerNamed:(nullable NSString *)fromLayer 44 | toLayerNamed:(nullable NSString *)toLayer 45 | applyAnimationTransform:(BOOL)applyAnimationTransform; 46 | 47 | /** 48 | The initializer to create a new transition animation. 49 | 50 | @param animation The name of the Lottie Animation to load for the transition 51 | 52 | @param fromLayer The name of the custom layer to mask the fromVC screenshot with. 53 | If no layer is specified then the screenshot is added behind the Lottie Animation 54 | 55 | @param toLayer The name of the custom layer to mask the toVC screenshot with. 56 | If no layer is specified then the screenshot is added behind the Lottie Animation 57 | and a fade transition is performed along with the Lottie animation. 58 | 59 | @param applyAnimationTransform A boolean that determines if the custom layer should 60 | have the transform animation from the After Effects layer applied to it. If NO the 61 | layer will be masked by the After Effects Layer 62 | 63 | @param bundle custom bundle to load animation and images, if no bundle is specified will load 64 | from mainBundle 65 | */ 66 | - (instancetype _Nonnull )initWithAnimationNamed:(NSString *_Nonnull)animation 67 | fromLayerNamed:(NSString *_Nullable)fromLayer 68 | toLayerNamed:(NSString *_Nullable)toLayer 69 | applyAnimationTransform:(BOOL)applyAnimationTransform 70 | inBundle:(NSBundle *_Nonnull)bundle; 71 | 72 | @end 73 | 74 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/ManipulatorNodes/LOTTrimPathNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTTrimPathNode.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/21/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTTrimPathNode.h" 10 | #import "LOTNumberInterpolator.h" 11 | #import "LOTPathAnimator.h" 12 | #import "LOTCircleAnimator.h" 13 | #import "LOTRoundedRectAnimator.h" 14 | #import "LOTRenderGroup.h" 15 | 16 | @implementation LOTTrimPathNode { 17 | LOTNumberInterpolator *_startInterpolator; 18 | LOTNumberInterpolator *_endInterpolator; 19 | LOTNumberInterpolator *_offsetInterpolator; 20 | 21 | CGFloat _startT; 22 | CGFloat _endT; 23 | CGFloat _offsetT; 24 | } 25 | 26 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 27 | trimPath:(LOTShapeTrimPath *_Nonnull)trimPath { 28 | self = [super initWithInputNode:inputNode keyName:trimPath.keyname]; 29 | if (self) { 30 | inputNode.pathShouldCacheLengths = YES; 31 | _startInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:trimPath.start.keyframes]; 32 | _endInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:trimPath.end.keyframes]; 33 | _offsetInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:trimPath.offset.keyframes]; 34 | } 35 | return self; 36 | } 37 | 38 | - (NSDictionary *)valueInterpolators { 39 | return @{@"Start" : _startInterpolator, 40 | @"End" : _endInterpolator, 41 | @"Offset" : _offsetInterpolator}; 42 | } 43 | 44 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 45 | return ([_startInterpolator hasUpdateForFrame:frame] || 46 | [_endInterpolator hasUpdateForFrame:frame] || 47 | [_offsetInterpolator hasUpdateForFrame:frame]); 48 | } 49 | 50 | - (BOOL)updateWithFrame:(NSNumber *)frame 51 | withModifierBlock:(void (^ _Nullable)(LOTAnimatorNode * _Nonnull))modifier 52 | forceLocalUpdate:(BOOL)forceUpdate { 53 | BOOL localUpdate = [self needsUpdateForFrame:frame]; 54 | [self forceSetCurrentFrame:frame]; 55 | if (localUpdate) { 56 | [self performLocalUpdate]; 57 | } 58 | if (self.inputNode == nil) { 59 | return localUpdate; 60 | } 61 | 62 | BOOL inputUpdated = [self.inputNode updateWithFrame:frame withModifierBlock:^(LOTAnimatorNode * _Nonnull inputNode) { 63 | if ([inputNode isKindOfClass:[LOTPathAnimator class]] || 64 | [inputNode isKindOfClass:[LOTCircleAnimator class]] || 65 | [inputNode isKindOfClass:[LOTRoundedRectAnimator class]]) { 66 | [inputNode.localPath trimPathFromT:_startT toT:_endT offset:_offsetT]; 67 | } 68 | if (modifier) { 69 | modifier(inputNode); 70 | } 71 | 72 | } forceLocalUpdate:(localUpdate || forceUpdate)]; 73 | 74 | return inputUpdated; 75 | } 76 | 77 | - (void)performLocalUpdate { 78 | _startT = [_startInterpolator floatValueForFrame:self.currentFrame] / 100; 79 | _endT = [_endInterpolator floatValueForFrame:self.currentFrame] / 100; 80 | _offsetT = [_offsetInterpolator floatValueForFrame:self.currentFrame] / 360; 81 | } 82 | 83 | - (void)rebuildOutputs { 84 | // Skip this step. 85 | } 86 | 87 | - (LOTBezierPath *)localPath { 88 | return self.inputNode.localPath; 89 | } 90 | 91 | /// Forwards its input node's output path forwards downstream 92 | - (LOTBezierPath *)outputPath { 93 | return self.inputNode.outputPath; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/AnimatableLayers/LOTMaskContainer.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTMaskContainer.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/19/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTMaskContainer.h" 10 | #import "LOTPathInterpolator.h" 11 | #import "LOTNumberInterpolator.h" 12 | 13 | @interface LOTMaskNodeLayer : CAShapeLayer 14 | 15 | @property (nonatomic, readonly) LOTMask *maskNode; 16 | 17 | - (instancetype)initWithMask:(LOTMask *)maskNode; 18 | - (BOOL)hasUpdateForFrame:(NSNumber *)frame; 19 | 20 | @end 21 | 22 | @implementation LOTMaskNodeLayer { 23 | LOTPathInterpolator *_pathInterpolator; 24 | LOTNumberInterpolator *_opacityInterpolator; 25 | LOTNumberInterpolator *_expansionInterpolator; 26 | } 27 | 28 | - (instancetype)initWithMask:(LOTMask *)maskNode { 29 | self = [super init]; 30 | if (self) { 31 | _pathInterpolator = [[LOTPathInterpolator alloc] initWithKeyframes:maskNode.maskPath.keyframes]; 32 | _opacityInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:maskNode.opacity.keyframes]; 33 | _expansionInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:maskNode.expansion.keyframes]; 34 | _maskNode = maskNode; 35 | self.fillColor = [UIColor blueColor].CGColor; 36 | } 37 | return self; 38 | } 39 | 40 | - (void)updateForFrame:(NSNumber *)frame withViewBounds:(CGRect)viewBounds { 41 | if ([self hasUpdateForFrame:frame]) { 42 | LOTBezierPath *path = [_pathInterpolator pathForFrame:frame cacheLengths:NO]; 43 | 44 | if (self.maskNode.maskMode == LOTMaskModeSubtract) { 45 | CGMutablePathRef pathRef = CGPathCreateMutable(); 46 | CGPathAddRect(pathRef, NULL, viewBounds); 47 | CGPathAddPath(pathRef, NULL, path.CGPath); 48 | self.path = pathRef; 49 | self.fillRule = @"even-odd"; 50 | } else { 51 | self.path = path.CGPath; 52 | } 53 | 54 | self.opacity = [_opacityInterpolator floatValueForFrame:frame]; 55 | } 56 | } 57 | 58 | - (BOOL)hasUpdateForFrame:(NSNumber *)frame { 59 | return ([_pathInterpolator hasUpdateForFrame:frame] || 60 | [_opacityInterpolator hasUpdateForFrame:frame]); 61 | } 62 | 63 | @end 64 | 65 | @implementation LOTMaskContainer { 66 | NSArray *_masks; 67 | } 68 | 69 | - (instancetype)initWithMasks:(NSArray *)masks { 70 | self = [super init]; 71 | if (self) { 72 | NSMutableArray *maskNodes = [NSMutableArray array]; 73 | CALayer *containerLayer = [CALayer layer]; 74 | 75 | for (LOTMask *mask in masks) { 76 | LOTMaskNodeLayer *node = [[LOTMaskNodeLayer alloc] initWithMask:mask]; 77 | [maskNodes addObject:node]; 78 | if (mask.maskMode == LOTMaskModeAdd || 79 | mask == masks.firstObject) { 80 | [containerLayer addSublayer:node]; 81 | } else { 82 | containerLayer.mask = node; 83 | CALayer *newContainer = [CALayer layer]; 84 | [newContainer addSublayer:containerLayer]; 85 | containerLayer = newContainer; 86 | } 87 | } 88 | [self addSublayer:containerLayer]; 89 | _masks = maskNodes; 90 | 91 | } 92 | return self; 93 | } 94 | 95 | - (void)setCurrentFrame:(NSNumber *)currentFrame { 96 | if (_currentFrame == currentFrame) { 97 | return; 98 | } 99 | _currentFrame = currentFrame; 100 | 101 | for (LOTMaskNodeLayer *nodeLayer in _masks) { 102 | [nodeLayer updateForFrame:currentFrame withViewBounds:self.bounds]; 103 | } 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Models/LOTShapeGroup.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTShape.m 3 | // LottieAnimator 4 | // 5 | // Created by Brandon Withrow on 12/14/15. 6 | // Copyright © 2015 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTShapeGroup.h" 10 | #import "LOTShapeFill.h" 11 | #import "LOTShapePath.h" 12 | #import "LOTShapeCircle.h" 13 | #import "LOTShapeStroke.h" 14 | #import "LOTShapeTransform.h" 15 | #import "LOTShapeRectangle.h" 16 | #import "LOTShapeTrimPath.h" 17 | #import "LOTShapeGradientFill.h" 18 | #import "LOTShapeStar.h" 19 | #import "LOTShapeRepeater.h" 20 | 21 | @implementation LOTShapeGroup 22 | 23 | - (instancetype)initWithJSON:(NSDictionary *)jsonDictionary { 24 | self = [super init]; 25 | if (self) { 26 | [self _mapFromJSON:jsonDictionary]; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)_mapFromJSON:(NSDictionary *)jsonDictionary { 32 | 33 | if (jsonDictionary[@"nm"] ) { 34 | _keyname = [jsonDictionary[@"nm"] copy]; 35 | } 36 | 37 | NSArray *itemsJSON = jsonDictionary[@"it"]; 38 | NSMutableArray *items = [NSMutableArray array]; 39 | for (NSDictionary *itemJSON in itemsJSON) { 40 | id newItem = [LOTShapeGroup shapeItemWithJSON:itemJSON]; 41 | if (newItem) { 42 | [items addObject:newItem]; 43 | } 44 | } 45 | _items = items; 46 | } 47 | 48 | + (id)shapeItemWithJSON:(NSDictionary *)itemJSON { 49 | NSString *type = itemJSON[@"ty"]; 50 | if ([type isEqualToString:@"gr"]) { 51 | LOTShapeGroup *group = [[LOTShapeGroup alloc] initWithJSON:itemJSON]; 52 | return group; 53 | } else if ([type isEqualToString:@"st"]) { 54 | LOTShapeStroke *stroke = [[LOTShapeStroke alloc] initWithJSON:itemJSON]; 55 | return stroke; 56 | } else if ([type isEqualToString:@"fl"]) { 57 | LOTShapeFill *fill = [[LOTShapeFill alloc] initWithJSON:itemJSON]; 58 | return fill; 59 | } else if ([type isEqualToString:@"tr"]) { 60 | LOTShapeTransform *transform = [[LOTShapeTransform alloc] initWithJSON:itemJSON]; 61 | return transform; 62 | } else if ([type isEqualToString:@"sh"]) { 63 | LOTShapePath *path = [[LOTShapePath alloc] initWithJSON:itemJSON]; 64 | return path; 65 | } else if ([type isEqualToString:@"el"]) { 66 | LOTShapeCircle *circle = [[LOTShapeCircle alloc] initWithJSON:itemJSON]; 67 | return circle; 68 | } else if ([type isEqualToString:@"rc"]) { 69 | LOTShapeRectangle *rectangle = [[LOTShapeRectangle alloc] initWithJSON:itemJSON]; 70 | return rectangle; 71 | } else if ([type isEqualToString:@"tm"]) { 72 | LOTShapeTrimPath *trim = [[LOTShapeTrimPath alloc] initWithJSON:itemJSON]; 73 | return trim; 74 | } else if ([type isEqualToString:@"gs"]) { 75 | NSLog(@"%s: Warning: gradient strokes are not supported", __PRETTY_FUNCTION__); 76 | } else if ([type isEqualToString:@"gf"]) { 77 | LOTShapeGradientFill *gradientFill = [[LOTShapeGradientFill alloc] initWithJSON:itemJSON]; 78 | return gradientFill; 79 | } else if ([type isEqualToString:@"sr"]) { 80 | LOTShapeStar *star = [[LOTShapeStar alloc] initWithJSON:itemJSON]; 81 | return star; 82 | } else if ([type isEqualToString:@"mm"]) { 83 | NSString *name = itemJSON[@"nm"]; 84 | NSLog(@"%s: Warning: merge shape is not supported. name: %@", __PRETTY_FUNCTION__, name); 85 | } else if ([type isEqualToString:@"rp"]) { 86 | LOTShapeRepeater *repeater = [[LOTShapeRepeater alloc] initWithJSON:itemJSON]; 87 | return repeater; 88 | } else { 89 | NSString *name = itemJSON[@"nm"]; 90 | NSLog(@"%s: Unsupported shape: %@ name: %@", __PRETTY_FUNCTION__, type, name); 91 | } 92 | 93 | return nil; 94 | } 95 | 96 | - (NSString*)description { 97 | NSMutableString *text = [[super description] mutableCopy]; 98 | [text appendFormat:@" items: %@", self.items]; 99 | return text; 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/MacCompatability/UIColor.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor.m 3 | // Lottie 4 | // 5 | // Created by Oleksii Pavlovskyi on 2/2/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR 10 | #import "UIColor.h" 11 | #import 12 | 13 | #define StaticColor(staticColor) \ 14 | static UIColor *color = nil; \ 15 | static dispatch_once_t onceToken; \ 16 | dispatch_once(&onceToken, ^{ \ 17 | color = NSColor.staticColor.UIColor; \ 18 | }); \ 19 | return color; \ 20 | 21 | @interface UIColor () 22 | 23 | @property (nonatomic, strong) NSColor *color; 24 | 25 | - (instancetype)initWithNSColor:(NSColor *)color; 26 | 27 | @end 28 | 29 | @interface NSColor (UIColor) 30 | 31 | @property (nonatomic, readonly) UIColor *UIColor; 32 | 33 | @end 34 | 35 | @implementation UIColor 36 | 37 | - (instancetype)initWithNSColor:(NSColor *)color { 38 | self = [super init]; 39 | if (self) { 40 | self.color = color; 41 | } 42 | return self; 43 | } 44 | 45 | + (UIColor *)colorWithNSColor:(NSColor *)color { 46 | return [[self alloc] initWithNSColor:color]; 47 | } 48 | 49 | + (UIColor *)colorWithWhite:(CGFloat)white alpha:(CGFloat)alpha { 50 | return [[NSColor colorWithWhite:white alpha:alpha] UIColor]; 51 | } 52 | 53 | + (UIColor *)colorWithHue:(CGFloat)hue 54 | saturation:(CGFloat)saturation 55 | brightness:(CGFloat)brightness 56 | alpha:(CGFloat)alpha { 57 | return [[NSColor colorWithHue:hue 58 | saturation:saturation 59 | brightness:brightness 60 | alpha:alpha] UIColor]; 61 | } 62 | 63 | + (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha { 64 | return [[NSColor colorWithRed:red 65 | green:green 66 | blue:blue 67 | alpha:alpha] UIColor]; 68 | } 69 | 70 | + (UIColor *)colorWithCGColor:(CGColorRef)cgColor { 71 | return [[NSColor colorWithCGColor:cgColor] UIColor]; 72 | } 73 | 74 | + (UIColor *)blackColor { 75 | StaticColor(blackColor) 76 | } 77 | 78 | + (UIColor *)darkGrayColor { 79 | StaticColor(darkGrayColor) 80 | } 81 | 82 | + (UIColor *)lightGrayColor { 83 | StaticColor(lightGrayColor) 84 | } 85 | 86 | + (UIColor *)whiteColor { 87 | StaticColor(whiteColor) 88 | } 89 | 90 | + (UIColor *)grayColor { 91 | StaticColor(grayColor) 92 | } 93 | 94 | + (UIColor *)redColor { 95 | StaticColor(redColor) 96 | } 97 | 98 | + (UIColor *)greenColor { 99 | StaticColor(greenColor) 100 | } 101 | 102 | + (UIColor *)blueColor { 103 | StaticColor(blueColor) 104 | } 105 | 106 | + (UIColor *)cyanColor { 107 | StaticColor(cyanColor) 108 | } 109 | 110 | + (UIColor *)yellowColor { 111 | StaticColor(yellowColor) 112 | } 113 | 114 | + (UIColor *)magentaColor { 115 | StaticColor(magentaColor) 116 | } 117 | 118 | + (UIColor *)orangeColor { 119 | StaticColor(orangeColor) 120 | } 121 | 122 | + (UIColor *)purpleColor { 123 | StaticColor(purpleColor) 124 | } 125 | 126 | + (UIColor *)brownColor { 127 | StaticColor(brownColor) 128 | } 129 | 130 | + (UIColor *)clearColor { 131 | StaticColor(clearColor) 132 | } 133 | 134 | - (CGColorRef)CGColor { 135 | return self.color.CGColor; 136 | } 137 | 138 | - (UIColor *)colorWithAlphaComponent:(CGFloat)alpha { 139 | return [self.color colorWithAlphaComponent:alpha].UIColor; 140 | } 141 | 142 | - (id)copyWithZone:(NSZone *)zone { 143 | return [[self.color copyWithZone:zone] UIColor]; 144 | } 145 | 146 | @end 147 | 148 | @implementation NSColor (UIColor) 149 | 150 | - (UIColor *)UIColor { 151 | return [UIColor colorWithNSColor:self]; 152 | } 153 | 154 | @end 155 | 156 | #endif 157 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTStrokeRenderer.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTStrokeRenderer.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/17/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTStrokeRenderer.h" 10 | #import "LOTColorInterpolator.h" 11 | #import "LOTNumberInterpolator.h" 12 | 13 | @implementation LOTStrokeRenderer { 14 | LOTColorInterpolator *_colorInterpolator; 15 | LOTNumberInterpolator *_opacityInterpolator; 16 | LOTNumberInterpolator *_widthInterpolator; 17 | LOTNumberInterpolator *_dashOffsetInterpolator; 18 | NSArray *_dashPatternInterpolators; 19 | } 20 | 21 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nonnull)inputNode 22 | shapeStroke:(LOTShapeStroke *_Nonnull)stroke { 23 | self = [super initWithInputNode:inputNode keyName:stroke.keyname]; 24 | if (self) { 25 | _colorInterpolator = [[LOTColorInterpolator alloc] initWithKeyframes:stroke.color.keyframes]; 26 | _opacityInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:stroke.opacity.keyframes]; 27 | _widthInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:stroke.width.keyframes]; 28 | 29 | NSMutableArray *dashPatternIntpolators = [NSMutableArray array]; 30 | NSMutableArray *dashPatterns = [NSMutableArray array]; 31 | for (LOTKeyframeGroup *keyframegroup in stroke.lineDashPattern) { 32 | LOTNumberInterpolator *interpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:keyframegroup.keyframes]; 33 | [dashPatternIntpolators addObject:interpolator]; 34 | if (dashPatterns && keyframegroup.keyframes.count == 1) { 35 | LOTKeyframe *first = keyframegroup.keyframes.firstObject; 36 | [dashPatterns addObject:@(first.floatValue)]; 37 | } 38 | if (keyframegroup.keyframes.count > 1) { 39 | dashPatterns = nil; 40 | } 41 | } 42 | 43 | if (dashPatterns.count) { 44 | self.outputLayer.lineDashPattern = dashPatterns; 45 | } else { 46 | _dashPatternInterpolators = dashPatternIntpolators; 47 | } 48 | 49 | if (stroke.dashOffset) { 50 | _dashOffsetInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:stroke.dashOffset.keyframes]; 51 | } 52 | 53 | self.outputLayer.fillColor = nil; 54 | self.outputLayer.lineCap = stroke.capType == LOTLineCapTypeRound ? kCALineCapRound : kCALineCapButt; 55 | switch (stroke.joinType) { 56 | case LOTLineJoinTypeBevel: 57 | self.outputLayer.lineJoin = kCALineJoinBevel; 58 | break; 59 | case LOTLineJoinTypeMiter: 60 | self.outputLayer.lineJoin = kCALineJoinMiter; 61 | break; 62 | case LOTLineJoinTypeRound: 63 | self.outputLayer.lineJoin = kCALineJoinRound; 64 | break; 65 | default: 66 | break; 67 | } 68 | } 69 | return self; 70 | } 71 | 72 | - (NSDictionary *)valueInterpolators { 73 | return @{@"Color" : _colorInterpolator, 74 | @"Opacity" : _opacityInterpolator, 75 | @"Stroke Width" : _widthInterpolator}; 76 | } 77 | 78 | - (void)_updateLineDashPatternsForFrame:(NSNumber *)frame { 79 | if (_dashPatternInterpolators.count) { 80 | NSMutableArray *lineDashPatterns = [NSMutableArray array]; 81 | for (LOTNumberInterpolator *interpolator in _dashPatternInterpolators) { 82 | [lineDashPatterns addObject:@([interpolator floatValueForFrame:frame])]; 83 | } 84 | self.outputLayer.lineDashPattern = lineDashPatterns; 85 | } 86 | } 87 | 88 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 89 | [self _updateLineDashPatternsForFrame:frame]; 90 | BOOL dashOffset = NO; 91 | if (_dashOffsetInterpolator) { 92 | dashOffset = [_dashOffsetInterpolator hasUpdateForFrame:frame]; 93 | } 94 | return (dashOffset || 95 | [_colorInterpolator hasUpdateForFrame:frame] || 96 | [_opacityInterpolator hasUpdateForFrame:frame] || 97 | [_widthInterpolator hasUpdateForFrame:frame]); 98 | } 99 | 100 | - (void)performLocalUpdate { 101 | self.outputLayer.lineDashPhase = [_dashOffsetInterpolator floatValueForFrame:self.currentFrame]; 102 | self.outputLayer.strokeColor = [_colorInterpolator colorForFrame:self.currentFrame].CGColor; 103 | self.outputLayer.lineWidth = [_widthInterpolator floatValueForFrame:self.currentFrame]; 104 | self.outputLayer.opacity = [_opacityInterpolator floatValueForFrame:self.currentFrame]; 105 | } 106 | 107 | - (void)rebuildOutputs { 108 | self.outputLayer.path = self.inputNode.outputPath.CGPath; 109 | } 110 | 111 | - (NSDictionary *)actionsForRenderLayer { 112 | return @{@"strokeColor": [NSNull null], 113 | @"lineWidth": [NSNull null], 114 | @"opacity" : [NSNull null]}; 115 | } 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /DYLottieDemo.xcodeproj/xcuserdata/yaolongkang.xcuserdatad/xcschemes/DYLottieDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-DYLottieDemo/Pods-DYLottieDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 104 | wait 105 | fi 106 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Private/LOTAnimationTransitionController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimationTransitionController.m 3 | // Lottie 4 | // 5 | // Created by Brandon Withrow on 1/18/17. 6 | // Copyright © 2017 Brandon Withrow. All rights reserved. 7 | // 8 | 9 | #import "LOTAnimationTransitionController.h" 10 | #import "LOTAnimationView.h" 11 | 12 | @implementation LOTAnimationTransitionController { 13 | LOTAnimationView *tranistionAnimationView_; 14 | NSString *fromLayerName_; 15 | NSString *toLayerName_; 16 | NSBundle *inBundle_; 17 | BOOL _applyTransform; 18 | } 19 | 20 | - (nonnull instancetype)initWithAnimationNamed:(nonnull NSString *)animation 21 | fromLayerNamed:(nullable NSString *)fromLayer 22 | toLayerNamed:(nullable NSString *)toLayer 23 | applyAnimationTransform:(BOOL)applyAnimationTransform { 24 | 25 | return [self initWithAnimationNamed:animation 26 | fromLayerNamed:fromLayer 27 | toLayerNamed:toLayer 28 | applyAnimationTransform:applyAnimationTransform 29 | inBundle:[NSBundle mainBundle]]; 30 | } 31 | 32 | - (instancetype)initWithAnimationNamed:(NSString *)animation 33 | fromLayerNamed:(NSString *)fromLayer 34 | toLayerNamed:(NSString *)toLayer 35 | applyAnimationTransform:(BOOL)applyAnimationTransform 36 | inBundle:(NSBundle *)bundle { 37 | self = [super init]; 38 | if (self) { 39 | tranistionAnimationView_ = [LOTAnimationView animationNamed:animation inBundle:bundle]; 40 | fromLayerName_ = fromLayer; 41 | toLayerName_ = toLayer; 42 | _applyTransform = applyAnimationTransform; 43 | } 44 | return self; 45 | } 46 | 47 | - (NSTimeInterval)transitionDuration:(id)transitionContext { 48 | return tranistionAnimationView_.animationDuration; 49 | } 50 | 51 | - (void)animateTransition:(id)transitionContext { 52 | UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 53 | UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 54 | UIView *containerView = transitionContext.containerView; 55 | 56 | UIView *toSnapshot = [toVC.view resizableSnapshotViewFromRect:containerView.bounds 57 | afterScreenUpdates:YES 58 | withCapInsets:UIEdgeInsetsZero]; 59 | toSnapshot.frame = containerView.bounds; 60 | 61 | UIView *fromSnapshot = [fromVC.view resizableSnapshotViewFromRect:containerView.bounds 62 | afterScreenUpdates:YES 63 | withCapInsets:UIEdgeInsetsZero]; 64 | fromSnapshot.frame = containerView.bounds; 65 | 66 | tranistionAnimationView_.frame = containerView.bounds; 67 | tranistionAnimationView_.contentMode = UIViewContentModeScaleAspectFill; 68 | [containerView addSubview:tranistionAnimationView_]; 69 | tranistionAnimationView_.animationProgress = 0; 70 | [tranistionAnimationView_ layoutSubviews]; 71 | BOOL crossFadeViews = NO; 72 | 73 | if (toLayerName_.length) { 74 | [tranistionAnimationView_ addSubview:toSnapshot toLayerNamed:toLayerName_ applyTransform:_applyTransform]; 75 | } else { 76 | [containerView addSubview:toSnapshot]; 77 | [containerView sendSubviewToBack:toSnapshot]; 78 | toSnapshot.alpha = 0; 79 | crossFadeViews = YES; 80 | } 81 | 82 | if (fromLayerName_.length) { 83 | [tranistionAnimationView_ addSubview:fromSnapshot toLayerNamed:fromLayerName_ applyTransform:_applyTransform]; 84 | } else { 85 | [containerView addSubview:fromSnapshot]; 86 | [containerView sendSubviewToBack:fromSnapshot]; 87 | } 88 | 89 | [containerView addSubview:toVC.view]; 90 | toVC.view.hidden = YES; 91 | 92 | if (crossFadeViews) { 93 | CGFloat duration = tranistionAnimationView_.animationDuration * 0.25; 94 | CGFloat delay = (tranistionAnimationView_.animationDuration - duration) / 2.f; 95 | 96 | [UIView animateWithDuration:duration 97 | delay:delay 98 | options:(UIViewAnimationOptionCurveEaseInOut) 99 | animations:^{ 100 | toSnapshot.alpha = 1; 101 | } completion:^(BOOL finished) { 102 | 103 | }]; 104 | } 105 | 106 | [tranistionAnimationView_ playWithCompletion:^(BOOL animationFinished) { 107 | toVC.view.hidden = false; 108 | [tranistionAnimationView_ removeFromSuperview]; 109 | [transitionContext completeTransition:animationFinished]; 110 | }]; 111 | } 112 | 113 | @end 114 | 115 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/RenderNodes/LOTRepeaterRenderer.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTRepeaterRenderer.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/28/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTRepeaterRenderer.h" 10 | #import "LOTTransformInterpolator.h" 11 | #import "LOTNumberInterpolator.h" 12 | #import "LOTHelpers.h" 13 | 14 | @implementation LOTRepeaterRenderer { 15 | LOTTransformInterpolator *_transformInterpolator; 16 | LOTNumberInterpolator *_copiesInterpolator; 17 | LOTNumberInterpolator *_offsetInterpolator; 18 | LOTNumberInterpolator *_startOpacityInterpolator; 19 | LOTNumberInterpolator *_endOpacityInterpolator; 20 | 21 | CALayer *_instanceLayer; 22 | CAReplicatorLayer *_replicatorLayer; 23 | CALayer *centerPoint_DEBUG; 24 | } 25 | 26 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nonnull)inputNode 27 | shapeRepeater:(LOTShapeRepeater *_Nonnull)repeater { 28 | self = [super initWithInputNode:inputNode keyName:repeater.keyname]; 29 | if (self) { 30 | _transformInterpolator = [[LOTTransformInterpolator alloc] initWithPosition:repeater.position.keyframes 31 | rotation:repeater.rotation.keyframes 32 | anchor:repeater.anchorPoint.keyframes 33 | scale:repeater.scale.keyframes]; 34 | _copiesInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:repeater.copies.keyframes]; 35 | _offsetInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:repeater.offset.keyframes]; 36 | _startOpacityInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:repeater.startOpacity.keyframes]; 37 | _endOpacityInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:repeater.endOpacity.keyframes]; 38 | 39 | _instanceLayer = [CALayer layer]; 40 | [self recursivelyAddChildLayers:inputNode]; 41 | 42 | _replicatorLayer = [CAReplicatorLayer layer]; 43 | _replicatorLayer.actions = @{@"instanceCount" : [NSNull null], 44 | @"instanceTransform" : [NSNull null], 45 | @"instanceAlphaOffset" : [NSNull null]}; 46 | [_replicatorLayer addSublayer:_instanceLayer]; 47 | [self.outputLayer addSublayer:_replicatorLayer]; 48 | 49 | centerPoint_DEBUG = [CALayer layer]; 50 | centerPoint_DEBUG.bounds = CGRectMake(0, 0, 20, 20); 51 | if (ENABLE_DEBUG_SHAPES) { 52 | [self.outputLayer addSublayer:centerPoint_DEBUG]; 53 | } 54 | } 55 | return self; 56 | } 57 | 58 | - (NSDictionary *)valueInterpolators { 59 | return @{@"Copies" : _copiesInterpolator, 60 | @"Offset" : _offsetInterpolator, 61 | @"Transform.Anchor Point" : _transformInterpolator.anchorInterpolator, 62 | @"Transform.Position" : _transformInterpolator.positionInterpolator, 63 | @"Transform.Scale" : _transformInterpolator.scaleInterpolator, 64 | @"Transform.Rotation" : _transformInterpolator.rotationInterpolator, 65 | @"Transform.Start Opacity" : _startOpacityInterpolator, 66 | @"Transform.End Opacity" : _endOpacityInterpolator}; 67 | } 68 | 69 | - (void)recursivelyAddChildLayers:(LOTAnimatorNode *)node { 70 | if ([node isKindOfClass:[LOTRenderNode class]]) { 71 | [_instanceLayer addSublayer:[(LOTRenderNode *)node outputLayer]]; 72 | } 73 | if (![node isKindOfClass:[LOTRepeaterRenderer class]] && 74 | node.inputNode) { 75 | [self recursivelyAddChildLayers:node.inputNode]; 76 | } 77 | } 78 | 79 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 80 | // TODO BW Add offset ability 81 | return ([_transformInterpolator hasUpdateForFrame:frame] || 82 | [_copiesInterpolator hasUpdateForFrame:frame] || 83 | [_startOpacityInterpolator hasUpdateForFrame:frame] || 84 | [_endOpacityInterpolator hasUpdateForFrame:frame]); 85 | } 86 | 87 | - (void)performLocalUpdate { 88 | centerPoint_DEBUG.backgroundColor = [UIColor greenColor].CGColor; 89 | centerPoint_DEBUG.borderColor = [UIColor lightGrayColor].CGColor; 90 | centerPoint_DEBUG.borderWidth = 2.f; 91 | 92 | CGFloat copies = ceilf([_copiesInterpolator floatValueForFrame:self.currentFrame]); 93 | _replicatorLayer.instanceCount = (NSInteger)copies; 94 | _replicatorLayer.instanceTransform = [_transformInterpolator transformForFrame:self.currentFrame]; 95 | CGFloat startOpacity = [_startOpacityInterpolator floatValueForFrame:self.currentFrame]; 96 | CGFloat endOpacity = [_endOpacityInterpolator floatValueForFrame:self.currentFrame]; 97 | CGFloat opacityStep = (endOpacity - startOpacity) / copies; 98 | _instanceLayer.opacity = startOpacity; 99 | _replicatorLayer.instanceAlphaOffset = opacityStep; 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/AnimatorNodes/LOTPolygonAnimator.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTPolygonAnimator.m 3 | // Lottie 4 | // 5 | // Created by brandon_withrow on 7/27/17. 6 | // Copyright © 2017 Airbnb. All rights reserved. 7 | // 8 | 9 | #import "LOTPolygonAnimator.h" 10 | #import "LOTKeyframe.h" 11 | #import "LOTPointInterpolator.h" 12 | #import "LOTNumberInterpolator.h" 13 | #import "LOTBezierPath.h" 14 | #import "CGGeometry+LOTAdditions.h" 15 | 16 | const CGFloat kPOLYGON_MAGIC_NUMBER = .25f; 17 | 18 | @implementation LOTPolygonAnimator { 19 | LOTNumberInterpolator *_outerRadiusInterpolator; 20 | LOTNumberInterpolator *_outerRoundnessInterpolator; 21 | LOTPointInterpolator *_positionInterpolator; 22 | LOTNumberInterpolator *_pointsInterpolator; 23 | LOTNumberInterpolator *_rotationInterpolator; 24 | } 25 | 26 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 27 | shapePolygon:(LOTShapeStar *_Nonnull)shapeStar { 28 | self = [super initWithInputNode:inputNode keyName:shapeStar.keyname]; 29 | if (self) { 30 | _outerRadiusInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:shapeStar.outerRadius.keyframes]; 31 | _outerRoundnessInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:shapeStar.outerRoundness.keyframes]; 32 | _pointsInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:shapeStar.numberOfPoints.keyframes]; 33 | _rotationInterpolator = [[LOTNumberInterpolator alloc] initWithKeyframes:shapeStar.rotation.keyframes]; 34 | _positionInterpolator = [[LOTPointInterpolator alloc] initWithKeyframes:shapeStar.position.keyframes]; 35 | } 36 | return self; 37 | } 38 | 39 | - (NSDictionary *)valueInterpolators { 40 | return @{@"Points" : _pointsInterpolator, 41 | @"Position" : _positionInterpolator, 42 | @"Rotation" : _rotationInterpolator, 43 | @"Outer Radius" : _outerRadiusInterpolator, 44 | @"Outer Roundness" : _outerRoundnessInterpolator}; 45 | } 46 | 47 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 48 | return ([_outerRadiusInterpolator hasUpdateForFrame:frame] || 49 | [_outerRoundnessInterpolator hasUpdateForFrame:frame] || 50 | [_pointsInterpolator hasUpdateForFrame:frame] || 51 | [_rotationInterpolator hasUpdateForFrame:frame] || 52 | [_positionInterpolator hasUpdateForFrame:frame]); 53 | } 54 | 55 | - (void)performLocalUpdate { 56 | CGFloat outerRadius = [_outerRadiusInterpolator floatValueForFrame:self.currentFrame]; 57 | CGFloat outerRoundness = [_outerRoundnessInterpolator floatValueForFrame:self.currentFrame] / 100.f; 58 | CGFloat points = [_pointsInterpolator floatValueForFrame:self.currentFrame]; 59 | CGFloat rotation = [_rotationInterpolator floatValueForFrame:self.currentFrame]; 60 | CGPoint position = [_positionInterpolator pointValueForFrame:self.currentFrame]; 61 | 62 | LOTBezierPath *path = [[LOTBezierPath alloc] init]; 63 | path.cacheLengths = self.pathShouldCacheLengths; 64 | CGFloat currentAngle = LOT_DegreesToRadians(rotation - 90); 65 | CGFloat anglePerPoint = (CGFloat)((2 * M_PI) / points); 66 | 67 | CGFloat x; 68 | CGFloat y; 69 | CGFloat previousX; 70 | CGFloat previousY; 71 | x = (CGFloat) (outerRadius * cosf(currentAngle)); 72 | y = (CGFloat) (outerRadius * sinf(currentAngle)); 73 | [path LOT_moveToPoint:CGPointMake(x, y)]; 74 | currentAngle += anglePerPoint; 75 | 76 | double numPoints = ceil(points); 77 | for (int i = 0; i < numPoints; i++) { 78 | previousX = x; 79 | previousY = y; 80 | x = (CGFloat) (outerRadius * cosf(currentAngle)); 81 | y = (CGFloat) (outerRadius * sinf(currentAngle)); 82 | 83 | if (outerRoundness != 0) { 84 | CGFloat cp1Theta = (CGFloat) (atan2(previousY, previousX) - M_PI / 2.f); 85 | CGFloat cp1Dx = (CGFloat) cosf(cp1Theta); 86 | CGFloat cp1Dy = (CGFloat) sinf(cp1Theta); 87 | 88 | CGFloat cp2Theta = (CGFloat) (atan2(y, x) - M_PI / 2.f); 89 | CGFloat cp2Dx = (CGFloat) cosf(cp2Theta); 90 | CGFloat cp2Dy = (CGFloat) sinf(cp2Theta); 91 | 92 | CGFloat cp1x = outerRadius * outerRoundness * kPOLYGON_MAGIC_NUMBER * cp1Dx; 93 | CGFloat cp1y = outerRadius * outerRoundness * kPOLYGON_MAGIC_NUMBER * cp1Dy; 94 | CGFloat cp2x = outerRadius * outerRoundness * kPOLYGON_MAGIC_NUMBER * cp2Dx; 95 | CGFloat cp2y = outerRadius * outerRoundness * kPOLYGON_MAGIC_NUMBER * cp2Dy; 96 | [path LOT_addCurveToPoint:CGPointMake(x, y) 97 | controlPoint1:CGPointMake(previousX - cp1x, previousY - cp1y) 98 | controlPoint2:CGPointMake(x + cp2x, y + cp2y)]; 99 | } else { 100 | [path LOT_addLineToPoint:CGPointMake(x, y)]; 101 | } 102 | 103 | currentAngle += anglePerPoint; 104 | } 105 | [path LOT_closePath]; 106 | [path LOT_applyTransform:CGAffineTransformMakeTranslation(position.x, position.y)]; 107 | self.localPath = path; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/RenderSystem/LOTAnimatorNode.m: -------------------------------------------------------------------------------- 1 | // 2 | // LOTAnimatorNode.m 3 | // Pods 4 | // 5 | // Created by brandon_withrow on 6/27/17. 6 | // 7 | // 8 | 9 | #import "LOTAnimatorNode.h" 10 | #import "LOTHelpers.h" 11 | #import "LOTValueInterpolator.h" 12 | 13 | NSInteger indentation_level = 0; 14 | 15 | @implementation LOTAnimatorNode 16 | 17 | 18 | - (instancetype _Nonnull )initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode 19 | keyName:(NSString *_Nullable)keyname { 20 | self = [super init]; 21 | if (self) { 22 | _keyname = keyname; 23 | _inputNode = inputNode; 24 | } 25 | return self; 26 | } 27 | 28 | /// To be overwritten by subclass. Defaults to YES 29 | - (BOOL)needsUpdateForFrame:(NSNumber *)frame { 30 | return YES; 31 | } 32 | 33 | /// The node checks if local update or if upstream update required. If upstream update outputs are rebuilt. If local update local update is performed. Returns no if no action 34 | - (BOOL)updateWithFrame:(NSNumber *_Nonnull)frame { 35 | return [self updateWithFrame:frame withModifierBlock:NULL forceLocalUpdate:NO]; 36 | } 37 | 38 | - (BOOL)updateWithFrame:(NSNumber *_Nonnull)frame 39 | withModifierBlock:(void (^_Nullable)(LOTAnimatorNode * _Nonnull inputNode))modifier 40 | forceLocalUpdate:(BOOL)forceUpdate{ 41 | if ([_currentFrame isEqual:frame] && !forceUpdate) { 42 | return NO; 43 | } 44 | NSString *name = NSStringFromClass([self class]); 45 | if (ENABLE_DEBUG_LOGGING) [self logString:[NSString stringWithFormat:@"%@ %lu %@ Checking for update", name, (unsigned long)self.hash, self.keyname]]; 46 | BOOL localUpdate = [self needsUpdateForFrame:frame] || forceUpdate; 47 | if (localUpdate && ENABLE_DEBUG_LOGGING) { 48 | [self logString:[NSString stringWithFormat:@"%@ %lu %@ Performing update", name, (unsigned long)self.hash, self.keyname]]; 49 | } 50 | BOOL inputUpdated = [_inputNode updateWithFrame:frame 51 | withModifierBlock:modifier 52 | forceLocalUpdate:forceUpdate]; 53 | _currentFrame = frame; 54 | if (localUpdate) { 55 | [self performLocalUpdate]; 56 | if (modifier) { 57 | modifier(self); 58 | } 59 | } 60 | 61 | if (inputUpdated || localUpdate) { 62 | [self rebuildOutputs]; 63 | } 64 | return (inputUpdated || localUpdate); 65 | } 66 | 67 | - (void)forceSetCurrentFrame:(NSNumber *_Nonnull)frame { 68 | _currentFrame = frame; 69 | } 70 | 71 | - (void)logString:(NSString *)string { 72 | NSMutableString *logString = [NSMutableString string]; 73 | [logString appendString:@"|"]; 74 | for (int i = 0; i < indentation_level; i ++) { 75 | [logString appendString:@" "]; 76 | } 77 | [logString appendString:string]; 78 | NSLog(@"%@", logString); 79 | } 80 | 81 | // TOBO BW Perf, make updates perform only when necessarry. Currently everything in a node is updated 82 | /// Performs any local content update and updates self.localPath 83 | - (void)performLocalUpdate { 84 | self.localPath = [[LOTBezierPath alloc] init]; 85 | } 86 | 87 | /// Rebuilts outputs by adding localPath to inputNodes output path. 88 | - (void)rebuildOutputs { 89 | if (self.inputNode) { 90 | self.outputPath = [self.inputNode.outputPath copy]; 91 | [self.outputPath LOT_appendPath:self.localPath]; 92 | } else { 93 | self.outputPath = self.localPath; 94 | } 95 | } 96 | 97 | - (void)setPathShouldCacheLengths:(BOOL)pathShouldCacheLengths { 98 | _pathShouldCacheLengths = pathShouldCacheLengths; 99 | self.inputNode.pathShouldCacheLengths = pathShouldCacheLengths; 100 | } 101 | 102 | /// Traverses children untill keypath is found and attempts to set the keypath to the value. 103 | - (BOOL)setValue:(nonnull id)value 104 | forKeyAtPath:(nonnull NSString *)keypath 105 | forFrame:(nullable NSNumber *)frame { 106 | NSArray *components = [keypath componentsSeparatedByString:@"."]; 107 | NSString *firstKey = components.firstObject; 108 | if ([firstKey isEqualToString:self.keyname] && components.count > 1) { 109 | NSString *nextPath = [keypath stringByReplacingCharactersInRange:NSMakeRange(0, firstKey.length + 1) withString:@""]; 110 | return [self setInterpolatorValue:value forKey:nextPath forFrame:frame]; 111 | } 112 | return [self.inputNode setValue:value forKeyAtPath:keypath forFrame:frame]; 113 | } 114 | 115 | /// Sets the keyframe to the value, to be overwritten by subclasses 116 | - (BOOL)setInterpolatorValue:(nonnull id)value 117 | forKey:(nonnull NSString *)key 118 | forFrame:(nullable NSNumber *)frame { 119 | LOTValueInterpolator *interpolator = self.valueInterpolators[key]; 120 | if (interpolator) { 121 | return [interpolator setValue:value atFrame:frame]; 122 | } 123 | return NO; 124 | } 125 | 126 | - (void)logHierarchyKeypathsWithParent:(NSString *)parent { 127 | NSString *keypath = self.keyname; 128 | if (parent && self.keyname) { 129 | keypath = [NSString stringWithFormat:@"%@.%@", parent, self.keyname]; 130 | } 131 | if (keypath) { 132 | for (NSString *interpolator in self.valueInterpolators.allKeys) { 133 | [self logString:[NSString stringWithFormat:@"%@.%@", keypath, interpolator]]; 134 | } 135 | } 136 | 137 | [self.inputNode logHierarchyKeypathsWithParent:parent]; 138 | } 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /Pods/lottie-ios/lottie-ios/Classes/Extensions/CGGeometry+LOTAdditions.h: -------------------------------------------------------------------------------- 1 | 2 | #import "LOTPlatformCompat.h" 3 | 4 | #import 5 | #import 6 | #import 7 | // 8 | // Core Graphics Geometry Additions 9 | // 10 | 11 | extern const CGSize CGSizeMax; 12 | 13 | CGRect LOT_RectIntegral(CGRect rect); 14 | 15 | // Centering 16 | 17 | // Returns a rectangle of the given size, centered at a point 18 | CGRect LOT_RectCenteredAtPoint(CGPoint center, CGSize size, BOOL integral); 19 | 20 | // Returns the center point of a CGRect 21 | CGPoint LOT_RectGetCenterPoint(CGRect rect); 22 | 23 | // Insetting 24 | 25 | // Inset the rectangle on a single edge 26 | CGRect LOT_RectInsetLeft(CGRect rect, CGFloat inset); 27 | CGRect LOT_RectInsetRight(CGRect rect, CGFloat inset); 28 | CGRect LOT_RectInsetTop(CGRect rect, CGFloat inset); 29 | CGRect LOT_RectInsetBottom(CGRect rect, CGFloat inset); 30 | 31 | // Inset the rectangle on two edges 32 | CGRect LOT_RectInsetHorizontal(CGRect rect, CGFloat leftInset, CGFloat rightInset); 33 | CGRect LOT_RectInsetVertical(CGRect rect, CGFloat topInset, CGFloat bottomInset); 34 | 35 | // Inset the rectangle on all edges 36 | CGRect LOT_RectInsetAll(CGRect rect, CGFloat leftInset, CGFloat rightInset, CGFloat topInset, CGFloat bottomInset); 37 | 38 | // Framing 39 | 40 | // Returns a rectangle of size framed in the center of the given rectangle 41 | CGRect LOT_RectFramedCenteredInRect(CGRect rect, CGSize size, BOOL integral); 42 | 43 | // Returns a rectangle of size framed in the given rectangle and inset 44 | CGRect LOT_RectFramedLeftInRect(CGRect rect, CGSize size, CGFloat inset, BOOL integral); 45 | CGRect LOT_RectFramedRightInRect(CGRect rect, CGSize size, CGFloat inset, BOOL integral); 46 | CGRect LOT_RectFramedTopInRect(CGRect rect, CGSize size, CGFloat inset, BOOL integral); 47 | CGRect LOT_RectFramedBottomInRect(CGRect rect, CGSize size, CGFloat inset, BOOL integral); 48 | 49 | CGRect LOT_RectFramedTopLeftInRect(CGRect rect, CGSize size, CGFloat insetWidth, CGFloat insetHeight, BOOL integral); 50 | CGRect LOT_RectFramedTopRightInRect(CGRect rect, CGSize size, CGFloat insetWidth, CGFloat insetHeight, BOOL integral); 51 | CGRect LOT_RectFramedBottomLeftInRect(CGRect rect, CGSize size, CGFloat insetWidth, CGFloat insetHeight, BOOL integral); 52 | CGRect LOT_RectFramedBottomRightInRect(CGRect rect, CGSize size, CGFloat insetWidth, CGFloat insetHeight, BOOL integral); 53 | 54 | // Divides a rect into sections and returns the section at specified index 55 | 56 | CGRect LOT_RectDividedSection(CGRect rect, NSInteger sections, NSInteger index, CGRectEdge fromEdge); 57 | 58 | // Returns a rectangle of size attached to the given rectangle 59 | CGRect LOT_RectAttachedLeftToRect(CGRect rect, CGSize size, CGFloat margin, BOOL integral); 60 | CGRect LOT_RectAttachedRightToRect(CGRect rect, CGSize size, CGFloat margin, BOOL integral); 61 | CGRect LOT_RectAttachedTopToRect(CGRect rect, CGSize size, CGFloat margin, BOOL integral); 62 | CGRect LOT_RectAttachedBottomToRect(CGRect rect, CGSize size, CGFloat margin, BOOL integral); 63 | 64 | CGRect LOT_RectAttachedBottomLeftToRect(CGRect rect, CGSize size, CGFloat marginWidth, CGFloat marginHeight, BOOL integral); 65 | CGRect LOT_RectAttachedBottomRightToRect(CGRect rect, CGSize size, CGFloat marginWidth, CGFloat marginHeight, BOOL integral); 66 | CGRect LOT_RectAttachedTopRightToRect(CGRect rect, CGSize size, CGFloat marginWidth, CGFloat marginHeight, BOOL integral); 67 | CGRect LOT_RectAttachedTopLeftToRect(CGRect rect, CGSize size, CGFloat marginWidth, CGFloat marginHeight, BOOL integral); 68 | 69 | BOOL LOT_CGPointIsZero(CGPoint point); 70 | 71 | // Combining 72 | // Adds all values of the 2nd rect to the first rect 73 | CGRect LOT_RectAddRect(CGRect rect, CGRect other); 74 | CGRect LOT_RectAddPoint(CGRect rect, CGPoint point); 75 | CGRect LOT_RectAddSize(CGRect rect, CGSize size); 76 | CGRect LOT_RectBounded(CGRect rect); 77 | 78 | CGPoint LOT_PointAddedToPoint(CGPoint point1, CGPoint point2); 79 | 80 | CGRect LOT_RectSetHeight(CGRect rect, CGFloat height); 81 | 82 | CGFloat LOT_PointDistanceFromPoint(CGPoint point1, CGPoint point2); 83 | CGFloat LOT_DegreesToRadians(CGFloat degrees); 84 | 85 | GLKMatrix4 LOT_GLKMatrix4FromCATransform(CATransform3D xform); 86 | 87 | CATransform3D LOT_CATransform3DFromGLKMatrix4(GLKMatrix4 xform); 88 | 89 | CATransform3D LOT_CATransform3DSlerpToTransform(CATransform3D fromXorm, CATransform3D toXform, CGFloat amount ); 90 | 91 | CGFloat LOT_RemapValue(CGFloat value, CGFloat low1, CGFloat high1, CGFloat low2, CGFloat high2 ); 92 | CGPoint LOT_PointByLerpingPoints(CGPoint point1, CGPoint point2, CGFloat value); 93 | 94 | CGPoint LOT_PointInLine(CGPoint A, CGPoint B, CGFloat T); 95 | CGPoint LOT_PointInCubicCurve(CGPoint start, CGPoint cp1, CGPoint cp2, CGPoint end, CGFloat T); 96 | 97 | CGFloat LOT_CubicBezeirInterpolate(CGPoint P0, CGPoint P1, CGPoint P2, CGPoint P3, CGFloat x); 98 | CGFloat LOT_SolveCubic(CGFloat a, CGFloat b, CGFloat c, CGFloat d); 99 | CGFloat LOT_SolveQuadratic(CGFloat a, CGFloat b, CGFloat c); 100 | CGFloat LOT_Squared(CGFloat f); 101 | CGFloat LOT_Cubed(CGFloat f); 102 | CGFloat LOT_CubicRoot(CGFloat f); 103 | 104 | CGFloat LOT_CubicLength(CGPoint fromPoint, CGPoint toPoint, CGPoint controlPoint1, CGPoint controlPoint2); 105 | CGFloat LOT_CubicLengthWithPrecision(CGPoint fromPoint, CGPoint toPoint, CGPoint controlPoint1, CGPoint controlPoint2, CGFloat iterations); 106 | --------------------------------------------------------------------------------