lottie-ios 4.4.3 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/main.yml +21 -49
- package/Lottie.xcodeproj/project.pbxproj +28 -0
- package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +7 -7
- package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Expressions.xcexplist +15 -0
- package/Package.resolved +2 -2
- package/Package.swift +7 -2
- package/README.md +4 -4
- package/Rakefile +1 -1
- package/Sources/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +2 -2
- package/Sources/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +7 -0
- package/Sources/Private/CoreAnimation/Animations/CustomPathAnimation.swift +2 -2
- package/Sources/Private/CoreAnimation/Animations/StrokeAnimation.swift +2 -0
- package/Sources/Private/CoreAnimation/Animations/TransformAnimations.swift +6 -6
- package/Sources/Private/CoreAnimation/CoreAnimationLayer.swift +20 -10
- package/Sources/Private/CoreAnimation/Extensions/Keyframes+combined.swift +2 -2
- package/Sources/Private/CoreAnimation/Layers/AnimationLayer.swift +7 -7
- package/Sources/Private/CoreAnimation/Layers/GradientRenderLayer.swift +1 -1
- package/Sources/Private/CoreAnimation/Layers/ShapeItemLayer.swift +12 -12
- package/Sources/Private/CoreAnimation/Layers/ShapeLayer.swift +19 -19
- package/Sources/Private/CoreAnimation/ValueProviderStore.swift +9 -4
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +1 -1
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +1 -1
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +2 -2
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +13 -6
- package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +1 -1
- package/Sources/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +6 -6
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +10 -6
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +10 -3
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +2 -2
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +5 -0
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +2 -0
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +15 -15
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +1 -0
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +1 -2
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +2 -2
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +2 -1
- package/Sources/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +12 -12
- package/Sources/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +30 -11
- package/Sources/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +1 -1
- package/Sources/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +11 -11
- package/Sources/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +4 -1
- package/Sources/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +1 -1
- package/Sources/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +24 -14
- package/Sources/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +22 -10
- package/Sources/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +3 -1
- package/Sources/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +101 -53
- package/Sources/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +17 -17
- package/Sources/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +2 -0
- package/Sources/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +5 -0
- package/Sources/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +3 -0
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +24 -0
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +1 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +3 -3
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +5 -5
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +15 -15
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +3 -3
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +18 -18
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +2 -2
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +9 -9
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +4 -4
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +1 -1
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +8 -8
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +10 -10
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +2 -2
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +4 -4
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +7 -7
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +10 -10
- package/Sources/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +61 -2
- package/Sources/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +6 -6
- package/Sources/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +17 -17
- package/Sources/Private/Model/Assets/Asset.swift +1 -1
- package/Sources/Private/Model/Assets/AssetLibrary.swift +6 -6
- package/Sources/Private/Model/Assets/ImageAsset.swift +7 -0
- package/Sources/Private/Model/Assets/PrecompAsset.swift +9 -0
- package/Sources/Private/Model/DotLottie/DotLottieAnimation.swift +2 -2
- package/Sources/Private/Model/Keyframes/KeyframeGroup.swift +10 -7
- package/Sources/Private/Model/LayerEffects/DropShadowEffect.swift +9 -0
- package/Sources/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +9 -0
- package/Sources/Private/Model/LayerEffects/EffectValues/EffectValue.swift +5 -5
- package/Sources/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +9 -0
- package/Sources/Private/Model/LayerEffects/LayerEffect.swift +3 -3
- package/Sources/Private/Model/LayerStyles/DropShadowStyle.swift +9 -0
- package/Sources/Private/Model/LayerStyles/LayerStyle.swift +3 -3
- package/Sources/Private/Model/Layers/ImageLayerModel.swift +9 -0
- package/Sources/Private/Model/Layers/LayerModel.swift +8 -8
- package/Sources/Private/Model/Layers/PreCompLayerModel.swift +9 -0
- package/Sources/Private/Model/Layers/ShapeLayerModel.swift +9 -0
- package/Sources/Private/Model/Layers/SolidLayerModel.swift +9 -0
- package/Sources/Private/Model/Layers/TextLayerModel.swift +9 -0
- package/Sources/Private/Model/ShapeItems/Ellipse.swift +7 -0
- package/Sources/Private/Model/ShapeItems/Fill.swift +7 -0
- package/Sources/Private/Model/ShapeItems/GradientFill.swift +7 -0
- package/Sources/Private/Model/ShapeItems/GradientStroke.swift +7 -0
- package/Sources/Private/Model/ShapeItems/Group.swift +9 -0
- package/Sources/Private/Model/ShapeItems/Merge.swift +7 -0
- package/Sources/Private/Model/ShapeItems/Rectangle.swift +9 -0
- package/Sources/Private/Model/ShapeItems/Repeater.swift +9 -0
- package/Sources/Private/Model/ShapeItems/RoundedCorners.swift +7 -0
- package/Sources/Private/Model/ShapeItems/Shape.swift +9 -0
- package/Sources/Private/Model/ShapeItems/ShapeItem.swift +16 -16
- package/Sources/Private/Model/ShapeItems/ShapeTransform.swift +9 -0
- package/Sources/Private/Model/ShapeItems/Star.swift +7 -0
- package/Sources/Private/Model/ShapeItems/Stroke.swift +9 -0
- package/Sources/Private/Model/ShapeItems/Trim.swift +9 -2
- package/Sources/Private/Model/Text/TextAnimator.swift +47 -1
- package/Sources/Private/RootAnimationLayer.swift +1 -0
- package/Sources/Private/Utility/Debugging/LayerDebugging.swift +6 -6
- package/Sources/Private/Utility/Extensions/AnimationKeypathExtension.swift +16 -16
- package/Sources/Private/Utility/Extensions/BlendMode+Filter.swift +16 -16
- package/Sources/Private/Utility/Extensions/CGColor+RGB.swift +18 -0
- package/Sources/Private/Utility/Extensions/CGFloatExtensions.swift +23 -23
- package/Sources/Private/Utility/Extensions/MathKit.swift +7 -15
- package/Sources/Private/Utility/Helpers/AnimationContext.swift +2 -2
- package/Sources/Private/Utility/Interpolatable/InterpolatableExtensions.swift +9 -3
- package/Sources/Private/Utility/LottieAnimationSource.swift +4 -4
- package/Sources/Private/Utility/Primitives/BezierPath.swift +16 -2
- package/Sources/Private/Utility/Primitives/BezierPathRoundExtension.swift +2 -2
- package/Sources/Private/Utility/Primitives/ColorExtension.swift +20 -20
- package/Sources/Private/Utility/Primitives/CompoundBezierPath.swift +9 -9
- package/Sources/Public/Animation/LottieAnimationLayer.swift +49 -34
- package/Sources/Public/Animation/LottieAnimationView.swift +26 -17
- package/Sources/Public/Animation/LottieAnimationViewInitializers.swift +4 -0
- package/Sources/Public/Animation/LottiePlaybackMode.swift +12 -12
- package/Sources/Public/Animation/LottieView.swift +40 -6
- package/Sources/Public/AnimationCache/DefaultAnimationCache.swift +1 -1
- package/Sources/Public/Configuration/ReducedMotionOption.swift +5 -5
- package/Sources/Public/Configuration/RenderingEngineOption.swift +4 -4
- package/Sources/Public/Controls/AnimatedControl.swift +5 -0
- package/Sources/Public/Controls/AnimatedSwitch.swift +6 -6
- package/Sources/Public/Controls/LottieButton.swift +1 -1
- package/Sources/Public/Controls/LottieSwitch.swift +1 -1
- package/Sources/Public/DotLottie/Cache/DotLottieCache.swift +1 -1
- package/Sources/Public/DotLottie/DotLottieFile.swift +2 -2
- package/Sources/Public/DynamicProperties/AnyValueProvider.swift +9 -9
- package/Sources/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +2 -2
- package/Sources/Public/Keyframes/Interpolatable.swift +2 -2
- package/Sources/Public/Keyframes/Keyframe.swift +1 -1
- package/Sources/Public/Logging/LottieLogger.swift +2 -2
- package/Sources/Public/Primitives/LottieColor.swift +3 -3
- package/Sources/Public/TextProvider/AnimationTextProvider.swift +4 -4
- package/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift +13 -12
- package/Sources/Public/macOS/LottieAnimationViewBase.macOS.swift +1 -1
- package/Version.xcconfig +2 -2
- package/lottie-ios.podspec +2 -2
- package/package.json +1 -1
|
@@ -9,15 +9,14 @@ on:
|
|
|
9
9
|
jobs:
|
|
10
10
|
build-package-no-visionOS:
|
|
11
11
|
name: "Build Package"
|
|
12
|
-
runs-on: macos-
|
|
12
|
+
runs-on: macos-14
|
|
13
13
|
strategy:
|
|
14
14
|
fail-fast: false
|
|
15
15
|
matrix:
|
|
16
16
|
xcode:
|
|
17
|
-
- '
|
|
18
|
-
- '14.3' # Swift 5.8
|
|
17
|
+
- '15.0.1' # Swift 5.9, but no visionOS support
|
|
19
18
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v4
|
|
21
20
|
- uses: ./.github/actions/setup
|
|
22
21
|
with:
|
|
23
22
|
xcode: ${{ matrix.xcode }}
|
|
@@ -35,7 +34,7 @@ jobs:
|
|
|
35
34
|
- '15.2' # Swift 5.9
|
|
36
35
|
- '15.3' # Swift 5.10
|
|
37
36
|
steps:
|
|
38
|
-
- uses: actions/checkout@
|
|
37
|
+
- uses: actions/checkout@v4
|
|
39
38
|
- uses: ./.github/actions/setup
|
|
40
39
|
with:
|
|
41
40
|
xcode: ${{ matrix.xcode }}
|
|
@@ -47,7 +46,7 @@ jobs:
|
|
|
47
46
|
name: "Build Example App"
|
|
48
47
|
runs-on: macos-14
|
|
49
48
|
steps:
|
|
50
|
-
- uses: actions/checkout@
|
|
49
|
+
- uses: actions/checkout@v4
|
|
51
50
|
- uses: ./.github/actions/setup
|
|
52
51
|
with:
|
|
53
52
|
xcode: '15.3' # Swift 5.10
|
|
@@ -58,7 +57,7 @@ jobs:
|
|
|
58
57
|
name: "Test Package"
|
|
59
58
|
runs-on: macos-14
|
|
60
59
|
steps:
|
|
61
|
-
- uses: actions/checkout@
|
|
60
|
+
- uses: actions/checkout@v4
|
|
62
61
|
- uses: ./.github/actions/setup
|
|
63
62
|
with:
|
|
64
63
|
xcode: '15.3' # Swift 5.10
|
|
@@ -69,7 +68,7 @@ jobs:
|
|
|
69
68
|
run: bundle exec rake test:process
|
|
70
69
|
- name: Upload artifacts
|
|
71
70
|
if: always()
|
|
72
|
-
uses: actions/upload-artifact@
|
|
71
|
+
uses: actions/upload-artifact@v4
|
|
73
72
|
with:
|
|
74
73
|
name: TestArtifacts
|
|
75
74
|
path: Tests/Artifacts
|
|
@@ -78,7 +77,7 @@ jobs:
|
|
|
78
77
|
name: "Emerge Upload"
|
|
79
78
|
runs-on: macos-14
|
|
80
79
|
steps:
|
|
81
|
-
- uses: actions/checkout@
|
|
80
|
+
- uses: actions/checkout@v4
|
|
82
81
|
- uses: ./.github/actions/setup
|
|
83
82
|
- name: Build Package
|
|
84
83
|
run: bundle exec rake emerge:upload
|
|
@@ -88,7 +87,7 @@ jobs:
|
|
|
88
87
|
|
|
89
88
|
build-xcframework-minimum-supported-version:
|
|
90
89
|
name: "Build XCFramework"
|
|
91
|
-
runs-on: macos-
|
|
90
|
+
runs-on: macos-14
|
|
92
91
|
strategy:
|
|
93
92
|
matrix:
|
|
94
93
|
xcode:
|
|
@@ -96,40 +95,13 @@ jobs:
|
|
|
96
95
|
# The Xcode version we use for this job is that oldest Xcode version that
|
|
97
96
|
# will be able to use these XCFrameworks and the lottie-spm package.
|
|
98
97
|
# This should be the minimum Xcode version permitted by the App Store.
|
|
99
|
-
# As of April
|
|
100
|
-
# -
|
|
101
|
-
#
|
|
102
|
-
# Testing in https://github.com/airbnb/lottie-spm/pull/12 shows that Xcode 15.0 can
|
|
103
|
-
# use an XCFramework built by Xcode 15.2.
|
|
104
|
-
- '14.1' # Swift 5.7.1
|
|
105
|
-
steps:
|
|
106
|
-
- uses: actions/checkout@v2
|
|
107
|
-
- uses: apple-actions/import-codesign-certs@v2
|
|
108
|
-
continue-on-error: true
|
|
109
|
-
with:
|
|
110
|
-
p12-file-base64: ${{ secrets.SIGNING_CERTIFICATE_BASE_64 }}
|
|
111
|
-
p12-password: ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
|
|
112
|
-
- uses: ./.github/actions/setup
|
|
113
|
-
with:
|
|
114
|
-
xcode: ${{ matrix.xcode }}
|
|
115
|
-
- name: Build XCFramework
|
|
116
|
-
run: SKIP_VISION_OS=true bundle exec rake build:xcframework[Lottie-Xcode-${{ matrix.xcode }}]
|
|
117
|
-
- name: Upload XCFramework
|
|
118
|
-
uses: actions/upload-artifact@v2
|
|
119
|
-
with:
|
|
120
|
-
name: BuildProducts
|
|
121
|
-
path: .build/archives
|
|
122
|
-
|
|
123
|
-
build-xcframework-with-visionOS-support:
|
|
124
|
-
name: "Build XCFramework"
|
|
125
|
-
runs-on: macos-14
|
|
126
|
-
strategy:
|
|
127
|
-
matrix:
|
|
128
|
-
xcode:
|
|
98
|
+
# As of April 2024, this is Xcode 15.0: https://developer.apple.com/news/?id=fxu2qp7b
|
|
99
|
+
# - However, testing in https://github.com/airbnb/lottie-spm/pull/12 shows that
|
|
100
|
+
# Xcode 15.0 can use an XCFramework built by Xcode 15.2.
|
|
129
101
|
- '15.2' # Swift 5.9, first Xcode version with visionOS support.
|
|
130
102
|
steps:
|
|
131
|
-
- uses: actions/checkout@
|
|
132
|
-
- uses: apple-actions/import-codesign-certs@
|
|
103
|
+
- uses: actions/checkout@v4
|
|
104
|
+
- uses: apple-actions/import-codesign-certs@v3
|
|
133
105
|
continue-on-error: true
|
|
134
106
|
with:
|
|
135
107
|
p12-file-base64: ${{ secrets.SIGNING_CERTIFICATE_BASE_64 }}
|
|
@@ -138,9 +110,9 @@ jobs:
|
|
|
138
110
|
with:
|
|
139
111
|
xcode: ${{ matrix.xcode }}
|
|
140
112
|
- name: Build XCFramework
|
|
141
|
-
run: bundle exec rake build:xcframework
|
|
113
|
+
run: bundle exec rake build:xcframework
|
|
142
114
|
- name: Upload XCFramework
|
|
143
|
-
uses: actions/upload-artifact@
|
|
115
|
+
uses: actions/upload-artifact@v4
|
|
144
116
|
with:
|
|
145
117
|
name: BuildProducts
|
|
146
118
|
path: .build/archives
|
|
@@ -153,7 +125,7 @@ jobs:
|
|
|
153
125
|
xcode:
|
|
154
126
|
- '15.3' # Swift 5.10
|
|
155
127
|
steps:
|
|
156
|
-
- uses: actions/checkout@
|
|
128
|
+
- uses: actions/checkout@v4
|
|
157
129
|
- uses: ./.github/actions/setup
|
|
158
130
|
with:
|
|
159
131
|
install-mint: false
|
|
@@ -169,7 +141,7 @@ jobs:
|
|
|
169
141
|
xcode:
|
|
170
142
|
- '15.3' # Swift 5.10
|
|
171
143
|
steps:
|
|
172
|
-
- uses: actions/checkout@
|
|
144
|
+
- uses: actions/checkout@v4
|
|
173
145
|
- uses: ./.github/actions/setup
|
|
174
146
|
with:
|
|
175
147
|
install-mint: true
|
|
@@ -181,7 +153,7 @@ jobs:
|
|
|
181
153
|
name: "Test Carthage support"
|
|
182
154
|
runs-on: macos-14
|
|
183
155
|
steps:
|
|
184
|
-
- uses: actions/checkout@
|
|
156
|
+
- uses: actions/checkout@v4
|
|
185
157
|
- uses: ./.github/actions/setup
|
|
186
158
|
with:
|
|
187
159
|
install-mint: true
|
|
@@ -194,7 +166,7 @@ jobs:
|
|
|
194
166
|
name: "Lint Swift"
|
|
195
167
|
runs-on: macos-14
|
|
196
168
|
steps:
|
|
197
|
-
- uses: actions/checkout@
|
|
169
|
+
- uses: actions/checkout@v4
|
|
198
170
|
- uses: ./.github/actions/setup
|
|
199
171
|
- name: Lint Swift
|
|
200
172
|
run: bundle exec rake lint:swift
|
|
@@ -203,7 +175,7 @@ jobs:
|
|
|
203
175
|
name: "Lint Embedded Libraries"
|
|
204
176
|
runs-on: macos-14
|
|
205
177
|
steps:
|
|
206
|
-
- uses: actions/checkout@
|
|
178
|
+
- uses: actions/checkout@v4
|
|
207
179
|
- uses: ./.github/actions/setup
|
|
208
180
|
- name: Lint Embedded Libraries
|
|
209
181
|
run: bundle exec rake lint:EmbeddedLibraries
|
|
@@ -1151,6 +1151,14 @@
|
|
|
1151
1151
|
D453D8B228FF9EA900D3F49C /* DefaultAnimationCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D453D8B028FF9E3A00D3F49C /* DefaultAnimationCache.swift */; };
|
|
1152
1152
|
D453D8B328FF9EAA00D3F49C /* DefaultAnimationCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D453D8B028FF9E3A00D3F49C /* DefaultAnimationCache.swift */; };
|
|
1153
1153
|
D453D8B428FF9EAA00D3F49C /* DefaultAnimationCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = D453D8B028FF9E3A00D3F49C /* DefaultAnimationCache.swift */; };
|
|
1154
|
+
E95C386F2C14B7FC00329910 /* DropShadowNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C386E2C14B7FC00329910 /* DropShadowNode.swift */; };
|
|
1155
|
+
E95C38712C14D14300329910 /* LayerEffectNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C38702C14D14300329910 /* LayerEffectNode.swift */; };
|
|
1156
|
+
E95C38722C15559500329910 /* DropShadowNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C386E2C14B7FC00329910 /* DropShadowNode.swift */; };
|
|
1157
|
+
E95C38732C15559600329910 /* DropShadowNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C386E2C14B7FC00329910 /* DropShadowNode.swift */; };
|
|
1158
|
+
E95C38742C15559700329910 /* DropShadowNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C386E2C14B7FC00329910 /* DropShadowNode.swift */; };
|
|
1159
|
+
E95C38752C15559D00329910 /* LayerEffectNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C38702C14D14300329910 /* LayerEffectNode.swift */; };
|
|
1160
|
+
E95C38762C15559E00329910 /* LayerEffectNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C38702C14D14300329910 /* LayerEffectNode.swift */; };
|
|
1161
|
+
E95C38772C15559F00329910 /* LayerEffectNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E95C38702C14D14300329910 /* LayerEffectNode.swift */; };
|
|
1154
1162
|
/* End PBXBuildFile section */
|
|
1155
1163
|
|
|
1156
1164
|
/* Begin PBXContainerItemProxy section */
|
|
@@ -1476,6 +1484,8 @@
|
|
|
1476
1484
|
D453D8AA28FE6EE300D3F49C /* LottieAnimationCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LottieAnimationCache.swift; sourceTree = "<group>"; };
|
|
1477
1485
|
D453D8AE28FF9BC600D3F49C /* AnimationCacheProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimationCacheProviderTests.swift; sourceTree = "<group>"; };
|
|
1478
1486
|
D453D8B028FF9E3A00D3F49C /* DefaultAnimationCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultAnimationCache.swift; sourceTree = "<group>"; };
|
|
1487
|
+
E95C386E2C14B7FC00329910 /* DropShadowNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DropShadowNode.swift; sourceTree = "<group>"; };
|
|
1488
|
+
E95C38702C14D14300329910 /* LayerEffectNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayerEffectNode.swift; sourceTree = "<group>"; };
|
|
1479
1489
|
/* End PBXFileReference section */
|
|
1480
1490
|
|
|
1481
1491
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -1959,6 +1969,7 @@
|
|
|
1959
1969
|
2E9C95662822F43000677516 /* Nodes */ = {
|
|
1960
1970
|
isa = PBXGroup;
|
|
1961
1971
|
children = (
|
|
1972
|
+
E95C386D2C14B7DC00329910 /* LayerEffectNodes */,
|
|
1962
1973
|
2E9C95672822F43000677516 /* ModifierNodes */,
|
|
1963
1974
|
2E9C95692822F43000677516 /* RenderContainers */,
|
|
1964
1975
|
2E9C956B2822F43000677516 /* OutputNodes */,
|
|
@@ -2446,6 +2457,15 @@
|
|
|
2446
2457
|
path = DotLottie;
|
|
2447
2458
|
sourceTree = "<group>";
|
|
2448
2459
|
};
|
|
2460
|
+
E95C386D2C14B7DC00329910 /* LayerEffectNodes */ = {
|
|
2461
|
+
isa = PBXGroup;
|
|
2462
|
+
children = (
|
|
2463
|
+
E95C386E2C14B7FC00329910 /* DropShadowNode.swift */,
|
|
2464
|
+
E95C38702C14D14300329910 /* LayerEffectNode.swift */,
|
|
2465
|
+
);
|
|
2466
|
+
path = LayerEffectNodes;
|
|
2467
|
+
sourceTree = "<group>";
|
|
2468
|
+
};
|
|
2449
2469
|
/* End PBXGroup section */
|
|
2450
2470
|
|
|
2451
2471
|
/* Begin PBXHeadersBuildPhase section */
|
|
@@ -2710,11 +2730,13 @@
|
|
|
2710
2730
|
080DEF6F2A95709700BE2D96 /* RenderingEngineOption.swift in Sources */,
|
|
2711
2731
|
080DEFB22A9570FE00BE2D96 /* ErasedContentProviding.swift in Sources */,
|
|
2712
2732
|
080DF0772A95717D00BE2D96 /* CompoundBezierPath.swift in Sources */,
|
|
2733
|
+
E95C38742C15559700329910 /* DropShadowNode.swift in Sources */,
|
|
2713
2734
|
080DEF8E2A9570D500BE2D96 /* LottieColor.swift in Sources */,
|
|
2714
2735
|
080DF0162A95713800BE2D96 /* PathOutputNode.swift in Sources */,
|
|
2715
2736
|
080DF00A2A95713000BE2D96 /* InvertedMatteLayer.swift in Sources */,
|
|
2716
2737
|
080DEFCD2A95711400BE2D96 /* Archive.swift in Sources */,
|
|
2717
2738
|
080DEF912A9570DD00BE2D96 /* LRUAnimationCache.swift in Sources */,
|
|
2739
|
+
E95C38772C15559F00329910 /* LayerEffectNode.swift in Sources */,
|
|
2718
2740
|
080DF05D2A95716A00BE2D96 /* ImageAsset.swift in Sources */,
|
|
2719
2741
|
080DF0722A95717D00BE2D96 /* UnitBezier.swift in Sources */,
|
|
2720
2742
|
080DF05E2A95716D00BE2D96 /* EffectValue.swift in Sources */,
|
|
@@ -3005,6 +3027,7 @@
|
|
|
3005
3027
|
2E9C96152822F43100677516 /* Transform.swift in Sources */,
|
|
3006
3028
|
2E9C97472822F43100677516 /* CGFloatExtensions.swift in Sources */,
|
|
3007
3029
|
2EAF5AC527A0798700E00531 /* UIColorExtension.swift in Sources */,
|
|
3030
|
+
E95C386F2C14B7FC00329910 /* DropShadowNode.swift in Sources */,
|
|
3008
3031
|
2E9C967E2822F43100677516 /* GradientStrokeRenderer.swift in Sources */,
|
|
3009
3032
|
08E207182A56014E002DCE17 /* SwiftUIView.swift in Sources */,
|
|
3010
3033
|
2E9C96932822F43100677516 /* PolygonNode.swift in Sources */,
|
|
@@ -3186,6 +3209,7 @@
|
|
|
3186
3209
|
2E9C97652822F43100677516 /* CurveVertex.swift in Sources */,
|
|
3187
3210
|
0820D5C52A8BF60F007D705C /* EffectValue.swift in Sources */,
|
|
3188
3211
|
08C002042A46150D00AB54BA /* FileManager+ZIP.swift in Sources */,
|
|
3212
|
+
E95C38712C14D14300329910 /* LayerEffectNode.swift in Sources */,
|
|
3189
3213
|
08E2072A2A56014E002DCE17 /* DidSelectProviding.swift in Sources */,
|
|
3190
3214
|
0820D5CD2A8BF6FF007D705C /* ColorEffectValue.swift in Sources */,
|
|
3191
3215
|
2E9C96482822F43100677516 /* NullCompositionLayer.swift in Sources */,
|
|
@@ -3318,6 +3342,7 @@
|
|
|
3318
3342
|
0887347028F0CBDE00458627 /* LottieAnimation.swift in Sources */,
|
|
3319
3343
|
2E9C97422822F43100677516 /* TestHelpers.swift in Sources */,
|
|
3320
3344
|
08EF21DD289C643B0097EA47 /* KeyframeInterpolator.swift in Sources */,
|
|
3345
|
+
E95C38722C15559500329910 /* DropShadowNode.swift in Sources */,
|
|
3321
3346
|
2E9C96162822F43100677516 /* Transform.swift in Sources */,
|
|
3322
3347
|
2E9C97482822F43100677516 /* CGFloatExtensions.swift in Sources */,
|
|
3323
3348
|
0820D5942A8ACD67007D705C /* LottieButton.swift in Sources */,
|
|
@@ -3499,6 +3524,7 @@
|
|
|
3499
3524
|
2E9C96492822F43100677516 /* NullCompositionLayer.swift in Sources */,
|
|
3500
3525
|
2EAF5AFF27A0798700E00531 /* GradientValueProvider.swift in Sources */,
|
|
3501
3526
|
2E9C96BE2822F43100677516 /* AnyValueContainer.swift in Sources */,
|
|
3527
|
+
E95C38752C15559D00329910 /* LayerEffectNode.swift in Sources */,
|
|
3502
3528
|
08E2072B2A56014E002DCE17 /* DidSelectProviding.swift in Sources */,
|
|
3503
3529
|
2E9C96612822F43100677516 /* LayerFontProvider.swift in Sources */,
|
|
3504
3530
|
6C7698442A38A71200E9BEF4 /* DotLottieConfiguration.swift in Sources */,
|
|
@@ -3605,6 +3631,7 @@
|
|
|
3605
3631
|
2E9C97492822F43100677516 /* CGFloatExtensions.swift in Sources */,
|
|
3606
3632
|
2EAF5AC727A0798700E00531 /* UIColorExtension.swift in Sources */,
|
|
3607
3633
|
2E9C96802822F43100677516 /* GradientStrokeRenderer.swift in Sources */,
|
|
3634
|
+
E95C38732C15559600329910 /* DropShadowNode.swift in Sources */,
|
|
3608
3635
|
2E9C96952822F43100677516 /* PolygonNode.swift in Sources */,
|
|
3609
3636
|
08E2071A2A56014E002DCE17 /* SwiftUIView.swift in Sources */,
|
|
3610
3637
|
2E9C96E62822F43100677516 /* MaskCompositionLayer.swift in Sources */,
|
|
@@ -3786,6 +3813,7 @@
|
|
|
3786
3813
|
2E9C97672822F43100677516 /* CurveVertex.swift in Sources */,
|
|
3787
3814
|
0820D5C72A8BF60F007D705C /* EffectValue.swift in Sources */,
|
|
3788
3815
|
2E9C964A2822F43100677516 /* NullCompositionLayer.swift in Sources */,
|
|
3816
|
+
E95C38762C15559E00329910 /* LayerEffectNode.swift in Sources */,
|
|
3789
3817
|
08E2072C2A56014E002DCE17 /* DidSelectProviding.swift in Sources */,
|
|
3790
3818
|
0820D5CF2A8BF6FF007D705C /* ColorEffectValue.swift in Sources */,
|
|
3791
3819
|
08C002ED2A46196300AB54BA /* Archive+Helpers.swift in Sources */,
|
package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate
CHANGED
|
Binary file
|
package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
CHANGED
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
<BreakpointProxy
|
|
8
8
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
9
9
|
<BreakpointContent
|
|
10
|
-
uuid = "
|
|
11
|
-
shouldBeEnabled = "
|
|
10
|
+
uuid = "608732A3-8389-4BD4-A600-81DB4BAB3BEB"
|
|
11
|
+
shouldBeEnabled = "Yes"
|
|
12
12
|
ignoreCount = "0"
|
|
13
13
|
continueAfterRunningActions = "No"
|
|
14
|
-
filePath = "Sources/
|
|
14
|
+
filePath = "Sources/Public/Animation/LottieAnimationLayer.swift"
|
|
15
15
|
startingColumnNumber = "9223372036854775807"
|
|
16
16
|
endingColumnNumber = "9223372036854775807"
|
|
17
|
-
startingLineNumber = "
|
|
18
|
-
endingLineNumber = "
|
|
19
|
-
landmarkName = "
|
|
20
|
-
landmarkType = "
|
|
17
|
+
startingLineNumber = "689"
|
|
18
|
+
endingLineNumber = "689"
|
|
19
|
+
landmarkName = "currentTime"
|
|
20
|
+
landmarkType = "24">
|
|
21
21
|
</BreakpointContent>
|
|
22
22
|
</BreakpointProxy>
|
|
23
23
|
</Breakpoints>
|
package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Expressions.xcexplist
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<VariablesViewState
|
|
3
|
+
version = "1.0">
|
|
4
|
+
<ContextStates>
|
|
5
|
+
<ContextState
|
|
6
|
+
contextName = "CoreAnimationLayer.init(animation:imageProvider:textProvider:fontProvider:maskAnimationToBounds:compatibilityTrackerMode:logger:):CoreAnimationLayer.swift">
|
|
7
|
+
</ContextState>
|
|
8
|
+
<ContextState
|
|
9
|
+
contextName = "CAShapeLayer.addAnimations(for:context:pathMultiplier:transformPath:roundedCorners:):CustomPathAnimation.swift">
|
|
10
|
+
</ContextState>
|
|
11
|
+
<ContextState
|
|
12
|
+
contextName = "closure #1 in CAShapeLayer.addAnimations(for:context:pathMultiplier:transformPath:roundedCorners:):CustomPathAnimation.swift">
|
|
13
|
+
</ContextState>
|
|
14
|
+
</ContextStates>
|
|
15
|
+
</VariablesViewState>
|
package/Package.resolved
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"kind" : "remoteSourceControl",
|
|
6
6
|
"location" : "https://github.com/airbnb/swift",
|
|
7
7
|
"state" : {
|
|
8
|
-
"revision" : "
|
|
9
|
-
"version" : "1.0.
|
|
8
|
+
"revision" : "c7e833face3f893b8defde66eecb66f24b55ca35",
|
|
9
|
+
"version" : "1.0.8"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
{
|
package/Package.swift
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
// swift-tools-version:5.
|
|
1
|
+
// swift-tools-version:5.9
|
|
2
2
|
import PackageDescription
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "Lottie",
|
|
6
6
|
// Minimum platform versions should be kept in sync with the per-platform targets in Lottie.xcodeproj, lottie-ios.podspec, and lottie-spm's Package.swift
|
|
7
7
|
platforms: [.iOS("13.0"), .macOS("10.15"), .tvOS("13.0"), .custom("visionOS", versionString: "1.0")],
|
|
8
|
-
products: [
|
|
8
|
+
products: [
|
|
9
|
+
.library(name: "Lottie", targets: ["Lottie"]),
|
|
10
|
+
// Product for dynamic linking, as SPM builds libraries statically by default.
|
|
11
|
+
// This product should be used in a modular project structure with multiple packages using Lottie to avoid duplicate symbols.
|
|
12
|
+
.library(name: "Lottie-Dynamic", type: .dynamic, targets: ["Lottie"]),
|
|
13
|
+
],
|
|
9
14
|
dependencies: [
|
|
10
15
|
.package(url: "https://github.com/airbnb/swift", .upToNextMajor(from: "1.0.1")),
|
|
11
16
|
],
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Lottie is a cross-platform library for iOS, macOS, tvOS, visionOS, [Android](https://github.com/airbnb/lottie-android), and [Web](https://github.com/airbnb/lottie-web) that natively renders vector-based animations and art in realtime with minimal code.
|
|
7
7
|
|
|
8
|
-
Lottie loads and renders animations and vectors exported in the bodymovin JSON format. Bodymovin JSON can be created and exported from After Effects with [bodymovin](https://github.com/bodymovin/bodymovin), Sketch with [Lottie Sketch Export](https://github.com/buba447/Lottie-Sketch-Export), and from [Haiku](https://www.
|
|
8
|
+
Lottie loads and renders animations and vectors exported in the bodymovin JSON format. Bodymovin JSON can be created and exported from After Effects with [bodymovin](https://github.com/bodymovin/bodymovin), Sketch with [Lottie Sketch Export](https://github.com/buba447/Lottie-Sketch-Export), and from [Haiku](https://www.haikuanimator.com).
|
|
9
9
|
|
|
10
10
|
Designers can create **and ship** beautiful animations without an engineer painstakingly recreating them by hand.
|
|
11
11
|
Since the animations are backed by JSON, they are extremely small in size but can be large in complexity!
|
|
@@ -33,7 +33,7 @@ You can pull the [Lottie Github Repo](https://github.com/airbnb/lottie-ios/) and
|
|
|
33
33
|
|
|
34
34
|
### Swift Package Manager
|
|
35
35
|
|
|
36
|
-
To install Lottie using [Swift Package Manager](https://github.com/
|
|
36
|
+
To install Lottie using [Swift Package Manager](https://github.com/swiftlang/swift-package-manager) you can follow the [tutorial published by Apple](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app) using the URL for the Lottie repo with the current version:
|
|
37
37
|
|
|
38
38
|
1. In Xcode, select “File” → “Add Packages...”
|
|
39
39
|
1. Enter https://github.com/airbnb/lottie-spm.git
|
|
@@ -41,7 +41,7 @@ To install Lottie using [Swift Package Manager](https://github.com/apple/swift-p
|
|
|
41
41
|
or you can add the following dependency to your `Package.swift`:
|
|
42
42
|
|
|
43
43
|
```swift
|
|
44
|
-
.package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.
|
|
44
|
+
.package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.5.0")
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
When using Swift Package Manager we recommend using the [lottie-spm](https://github.com/airbnb/lottie-spm) repo instead of the main lottie-ios repo. The main git repository for [lottie-ios](https://github.com/airbnb/lottie-ios) is somewhat large (300+ MB), and Swift Package Manager always downloads the full repository with all git history. The [lottie-spm](https://github.com/airbnb/lottie-spm) repo is much smaller (less than 500kb), so can be downloaded much more quickly.
|
|
@@ -77,7 +77,7 @@ In your application targets “General” tab under the “Linked Frameworks and
|
|
|
77
77
|
|
|
78
78
|
## Swift Version Support
|
|
79
79
|
|
|
80
|
-
Lottie supports Swift / Xcode versions back to the minimum version that is
|
|
80
|
+
Lottie supports Swift / Xcode versions back to the minimum version that is permitted by Apple for submissions to the App Store. You can see the most up-to-date information for which Swift versions Lottie supports on [Swift Package Index](https://swiftpackageindex.com/airbnb/lottie-ios):
|
|
81
81
|
|
|
82
82
|
[](https://swiftpackageindex.com/airbnb/lottie-ios)
|
|
83
83
|
|
package/Rakefile
CHANGED
|
@@ -249,7 +249,7 @@ def xcodebuild(command)
|
|
|
249
249
|
end
|
|
250
250
|
|
|
251
251
|
# Runs the given code block, unless `SKIP_VISION_OS=true`.
|
|
252
|
-
# TODO: Remove this once
|
|
252
|
+
# TODO: Remove this once Lottie only supports Xcode 15.2+.
|
|
253
253
|
def ifVisionOSEnabled
|
|
254
254
|
if ENV["SKIP_VISION_OS"] == "true"
|
|
255
255
|
puts "Skipping visionOS build"
|
|
@@ -305,9 +305,9 @@ extension CALayer {
|
|
|
305
305
|
// to segments based on the `CAAnimationCalculationMode`, so we can just
|
|
306
306
|
// check the first keyframe.
|
|
307
307
|
if keyframes[0].isHold {
|
|
308
|
-
|
|
308
|
+
.discrete
|
|
309
309
|
} else {
|
|
310
|
-
|
|
310
|
+
.linear
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
|
|
@@ -82,3 +82,10 @@ extension CombinedShapeItem {
|
|
|
82
82
|
name: name)
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
// MARK: Sendable
|
|
87
|
+
|
|
88
|
+
/// `CombinedShapeItem` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
89
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
90
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
91
|
+
extension CombinedShapeItem: @unchecked Sendable { }
|
|
@@ -61,8 +61,8 @@ struct BezierPathKeyframe: Interpolatable {
|
|
|
61
61
|
/// that can have different counts / timing parameters
|
|
62
62
|
static func combining(
|
|
63
63
|
path: KeyframeGroup<BezierPath>,
|
|
64
|
-
cornerRadius: KeyframeGroup<LottieVector1D>?)
|
|
65
|
-
-> KeyframeGroup<BezierPathKeyframe>
|
|
64
|
+
cornerRadius: KeyframeGroup<LottieVector1D>?)
|
|
65
|
+
throws -> KeyframeGroup<BezierPathKeyframe>
|
|
66
66
|
{
|
|
67
67
|
guard
|
|
68
68
|
let cornerRadius,
|
|
@@ -23,6 +23,7 @@ extension Stroke: StrokeShapeItem {
|
|
|
23
23
|
|
|
24
24
|
func copy(width: KeyframeGroup<LottieVector1D>) -> StrokeShapeItem {
|
|
25
25
|
// Type-erase the copy from `Stroke` to `StrokeShapeItem`
|
|
26
|
+
// swiftformat:disable:next redundantProperty
|
|
26
27
|
let copy: Stroke = copy(width: width)
|
|
27
28
|
return copy
|
|
28
29
|
}
|
|
@@ -35,6 +36,7 @@ extension GradientStroke: StrokeShapeItem {
|
|
|
35
36
|
|
|
36
37
|
func copy(width: KeyframeGroup<LottieVector1D>) -> StrokeShapeItem {
|
|
37
38
|
// Type-erase the copy from `GradientStroke` to `StrokeShapeItem`
|
|
39
|
+
// swiftformat:disable:next redundantProperty
|
|
38
40
|
let copy: GradientStroke = copy(width: width)
|
|
39
41
|
return copy
|
|
40
42
|
}
|
|
@@ -280,12 +280,12 @@ extension CALayer {
|
|
|
280
280
|
anchor, position, positionX, positionY, scale, rotationX, rotationY, rotationZ, skew, skewAxis
|
|
281
281
|
-> Hold<CATransform3D> in
|
|
282
282
|
|
|
283
|
-
let transformPosition: CGPoint
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
283
|
+
let transformPosition: CGPoint =
|
|
284
|
+
if transformModel._positionX != nil, transformModel._positionY != nil {
|
|
285
|
+
CGPoint(x: positionX.cgFloatValue, y: positionY.cgFloatValue)
|
|
286
|
+
} else {
|
|
287
|
+
position.pointValue
|
|
288
|
+
}
|
|
289
289
|
|
|
290
290
|
let transform = CATransform3D.makeTransform(
|
|
291
291
|
anchor: anchor.pointValue,
|
|
@@ -308,8 +308,8 @@ final class CoreAnimationLayer: BaseAnimationLayer {
|
|
|
308
308
|
add(timedProgressAnimation, forKey: #keyPath(animationProgress))
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
|
|
312
|
-
|
|
311
|
+
/// Removes the current `CAAnimation`s, and rebuilds new animations
|
|
312
|
+
/// using the same configuration as the previous animations.
|
|
313
313
|
private func rebuildCurrentAnimation() {
|
|
314
314
|
guard
|
|
315
315
|
// Don't replace any pending animations that are queued to begin
|
|
@@ -343,15 +343,15 @@ extension CoreAnimationLayer: RootAnimationLayer {
|
|
|
343
343
|
var isAnimationPlaying: Bool? {
|
|
344
344
|
switch pendingAnimationConfiguration?.playbackState {
|
|
345
345
|
case .playing:
|
|
346
|
-
|
|
346
|
+
true
|
|
347
347
|
case .paused:
|
|
348
|
-
|
|
348
|
+
false
|
|
349
349
|
case nil:
|
|
350
350
|
switch playbackState {
|
|
351
351
|
case .playing:
|
|
352
|
-
|
|
352
|
+
animation(forKey: #keyPath(animationProgress)) != nil
|
|
353
353
|
case nil, .paused:
|
|
354
|
-
|
|
354
|
+
false
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
}
|
|
@@ -424,9 +424,11 @@ extension CoreAnimationLayer: RootAnimationLayer {
|
|
|
424
424
|
var respectAnimationFrameRate: Bool {
|
|
425
425
|
get { false }
|
|
426
426
|
set {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
if newValue {
|
|
428
|
+
logger.assertionFailure("""
|
|
429
|
+
The Core Animation rendering engine currently doesn't support `respectAnimationFrameRate`)
|
|
430
|
+
""")
|
|
431
|
+
}
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
434
|
|
|
@@ -495,6 +497,14 @@ extension CoreAnimationLayer: RootAnimationLayer {
|
|
|
495
497
|
rebuildCurrentAnimation()
|
|
496
498
|
}
|
|
497
499
|
|
|
500
|
+
func removeValueProvider(for keypath: AnimationKeypath) {
|
|
501
|
+
valueProviderStore.removeValueProvider(for: keypath)
|
|
502
|
+
|
|
503
|
+
// We need to rebuild the current animation after removing a value provider,
|
|
504
|
+
// since any existing `CAAnimation`s could now be out of date.
|
|
505
|
+
rebuildCurrentAnimation()
|
|
506
|
+
}
|
|
507
|
+
|
|
498
508
|
func getValue(for _: AnimationKeypath, atFrame _: AnimationFrameTime?) -> Any? {
|
|
499
509
|
logger.assertionFailure("""
|
|
500
510
|
The Core Animation rendering engine doesn't support querying values for individual frames
|
|
@@ -584,7 +594,7 @@ extension CALayer {
|
|
|
584
594
|
var numberOfSublayersWithTimeRemapping = 0
|
|
585
595
|
|
|
586
596
|
for sublayer in sublayers ?? [] {
|
|
587
|
-
if
|
|
597
|
+
if
|
|
588
598
|
let preCompLayer = sublayer as? PreCompLayer,
|
|
589
599
|
preCompLayer.preCompLayer.timeRemapping != nil
|
|
590
600
|
{
|
|
@@ -320,9 +320,9 @@ extension KeyframeGroup {
|
|
|
320
320
|
/// The value to use for a combined set of keyframes, for the given index
|
|
321
321
|
fileprivate func valueForCombinedKeyframes(at index: Int) -> T {
|
|
322
322
|
if keyframes.count == 1 {
|
|
323
|
-
|
|
323
|
+
keyframes[0].value
|
|
324
324
|
} else {
|
|
325
|
-
|
|
325
|
+
keyframes[index].value
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -15,7 +15,7 @@ protocol AnimationLayer: CALayer {
|
|
|
15
15
|
|
|
16
16
|
// MARK: - LayerAnimationContext
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
/// Context describing the timing parameters of the current animation
|
|
19
19
|
struct LayerAnimationContext {
|
|
20
20
|
/// The animation being played
|
|
21
21
|
let animation: LottieAnimation
|
|
@@ -74,12 +74,12 @@ struct LayerAnimationContext {
|
|
|
74
74
|
// Normal animation playback (like when looping) skips the last frame.
|
|
75
75
|
// However when the animation is paused, we need to be able to render the final frame.
|
|
76
76
|
// To allow this we have to extend the length of the animation by one frame.
|
|
77
|
-
let animationEndFrame: AnimationFrameTime
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
let animationEndFrame: AnimationFrameTime =
|
|
78
|
+
if timingConfiguration.speed == 0 {
|
|
79
|
+
animation.endFrame + 1
|
|
80
|
+
} else {
|
|
81
|
+
animation.endFrame
|
|
82
|
+
}
|
|
83
83
|
|
|
84
84
|
return Double(animationEndFrame - animation.startFrame) / animation.framerate
|
|
85
85
|
}
|
|
@@ -25,7 +25,7 @@ final class GradientRenderLayer: CAGradientLayer {
|
|
|
25
25
|
|
|
26
26
|
/// The reference bounds within this layer that the gradient's
|
|
27
27
|
/// `startPoint` and `endPoint` should be calculated relative to
|
|
28
|
-
var gradientReferenceBounds
|
|
28
|
+
var gradientReferenceBounds = CGRect.zero {
|
|
29
29
|
didSet {
|
|
30
30
|
if oldValue != gradientReferenceBounds {
|
|
31
31
|
updateLayout()
|
|
@@ -118,19 +118,19 @@ final class ShapeItemLayer: BaseAnimationLayer {
|
|
|
118
118
|
// We have to build a different layer hierarchy depending on if
|
|
119
119
|
// we're rendering a gradient (a `CAGradientLayer` masked by a `CAShapeLayer`)
|
|
120
120
|
// or a solid shape (a simple `CAShapeLayer`).
|
|
121
|
-
let fillLayerConfiguration: FillLayerConfiguration
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
let fillLayerConfiguration: FillLayerConfiguration =
|
|
122
|
+
if let gradientFill = otherItems.first(GradientFill.self) {
|
|
123
|
+
setupGradientFillLayerHierarchy(for: gradientFill)
|
|
124
|
+
} else {
|
|
125
|
+
setupSolidFillLayerHierarchy()
|
|
126
|
+
}
|
|
127
127
|
|
|
128
|
-
let gradientStrokeConfiguration: GradientLayers?
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
let gradientStrokeConfiguration: GradientLayers? =
|
|
129
|
+
if let gradientStroke = otherItems.first(GradientStroke.self) {
|
|
130
|
+
setupGradientStrokeLayerHierarchy(for: gradientStroke)
|
|
131
|
+
} else {
|
|
132
|
+
nil
|
|
133
|
+
}
|
|
134
134
|
|
|
135
135
|
sublayerConfiguration = (fillLayerConfiguration, gradientStrokeConfiguration)
|
|
136
136
|
}
|