lottie-ios 4.1.2 → 4.2.0

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.
Files changed (96) hide show
  1. package/.github/workflows/main.yml +27 -9
  2. package/Lottie.xcodeproj/project.pbxproj +158 -70
  3. package/Lottie.xcodeproj/xcuserdata/calstephens.xcuserdatad/xcschemes/xcschememanagement.plist +2 -2
  4. package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/IDEFindNavigatorScopes.plist +5 -0
  5. package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  6. package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +258 -0
  7. package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Expressions.xcexplist +13 -2
  8. package/Package.swift +2 -1
  9. package/README.md +3 -3
  10. package/Rakefile +8 -4
  11. package/Sources/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +16 -2
  12. package/Sources/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +1 -1
  13. package/Sources/Private/CoreAnimation/Animations/CustomPathAnimation.swift +1 -1
  14. package/Sources/Private/CoreAnimation/Animations/EllipseAnimation.swift +1 -1
  15. package/Sources/Private/CoreAnimation/Animations/GradientAnimations.swift +6 -6
  16. package/Sources/Private/CoreAnimation/Animations/LayerProperty.swift +76 -7
  17. package/Sources/Private/CoreAnimation/Animations/OpacityAnimation.swift +1 -1
  18. package/Sources/Private/CoreAnimation/Animations/RectangleAnimation.swift +1 -1
  19. package/Sources/Private/CoreAnimation/Animations/ShapeAnimation.swift +66 -102
  20. package/Sources/Private/CoreAnimation/Animations/StarAnimation.swift +2 -2
  21. package/Sources/Private/CoreAnimation/Animations/StrokeAnimation.swift +3 -3
  22. package/Sources/Private/CoreAnimation/Animations/TransformAnimations.swift +66 -17
  23. package/Sources/Private/CoreAnimation/CoreAnimationLayer.swift +55 -32
  24. package/Sources/Private/CoreAnimation/Extensions/Keyframes+combined.swift +16 -12
  25. package/Sources/Private/CoreAnimation/Layers/AnimationLayer.swift +3 -3
  26. package/Sources/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +24 -11
  27. package/Sources/Private/CoreAnimation/Layers/ImageLayer.swift +2 -2
  28. package/Sources/Private/CoreAnimation/Layers/PreCompLayer.swift +1 -1
  29. package/Sources/Private/CoreAnimation/Layers/RepeaterLayer.swift +13 -2
  30. package/Sources/Private/CoreAnimation/Layers/ShapeLayer.swift +9 -1
  31. package/Sources/Private/CoreAnimation/ValueProviderStore.swift +22 -11
  32. package/Sources/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +1 -1
  33. package/Sources/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +13 -2
  34. package/Sources/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +16 -7
  35. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +1 -1
  36. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +2 -2
  37. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +1 -1
  38. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +2 -2
  39. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +20 -8
  40. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +1 -1
  41. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +1 -1
  42. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +1 -1
  43. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +1 -1
  44. package/Sources/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +28 -9
  45. package/Sources/Private/Model/Assets/ImageAsset.swift +4 -3
  46. package/Sources/Private/Model/DotLottie/DotLottieAnimation.swift +2 -8
  47. package/Sources/Private/Model/DotLottie/DotLottieManifest.swift +3 -14
  48. package/Sources/Private/Model/DotLottie/DotLottieUtils.swift +11 -1
  49. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+BackingConfiguration.swift +147 -0
  50. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+Helpers.swift +351 -0
  51. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+MemoryFile.swift +183 -0
  52. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+Progress.swift +66 -0
  53. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+Reading.swift +144 -0
  54. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+ReadingDeprecated.swift +49 -0
  55. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+Writing.swift +385 -0
  56. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+WritingDeprecated.swift +91 -0
  57. package/Sources/Private/Model/DotLottie/ZipFoundation/Archive+ZIP64.swift +170 -0
  58. package/Sources/Private/Model/DotLottie/{Zip/ZipArchive.swift → ZipFoundation/Archive.swift} +150 -227
  59. package/Sources/Private/Model/DotLottie/ZipFoundation/Data+Compression.swift +403 -0
  60. package/Sources/Private/Model/DotLottie/ZipFoundation/Data+CompressionDeprecated.swift +44 -0
  61. package/Sources/Private/Model/DotLottie/{Zip → ZipFoundation}/Data+Serialization.swift +62 -0
  62. package/Sources/Private/Model/DotLottie/{Zip/ZipEntry+Serialization.swift → ZipFoundation/Entry+Serialization.swift} +7 -7
  63. package/Sources/Private/Model/DotLottie/{Zip/ZipEntry+ZIP64.swift → ZipFoundation/Entry+ZIP64.swift} +13 -19
  64. package/Sources/Private/Model/DotLottie/{Zip/ZipEntry.swift → ZipFoundation/Entry.swift} +141 -10
  65. package/Sources/Private/Model/DotLottie/ZipFoundation/FileManager+ZIP.swift +368 -0
  66. package/Sources/Private/Model/DotLottie/ZipFoundation/README.md +24 -0
  67. package/Sources/Private/Model/DotLottie/ZipFoundation/URL+ZIP.swift +32 -0
  68. package/Sources/Private/Model/Extensions/Bundle.swift +5 -14
  69. package/Sources/Private/Model/Keyframes/KeyframeGroup.swift +31 -8
  70. package/Sources/Private/Model/Objects/Transform.swift +58 -17
  71. package/Sources/Private/Model/ShapeItems/Repeater.swift +41 -7
  72. package/Sources/Private/Model/ShapeItems/ShapeTransform.swift +61 -7
  73. package/Sources/Private/Model/Text/TextAnimator.swift +37 -5
  74. package/Sources/Private/RootAnimationLayer.swift +3 -1
  75. package/Sources/Private/Utility/Extensions/AnimationKeypathExtension.swift +12 -4
  76. package/Sources/Private/Utility/Extensions/DataExtension.swift +14 -4
  77. package/Sources/Private/Utility/Primitives/BezierPathRoundExtension.swift +11 -0
  78. package/Sources/Private/Utility/Primitives/ColorExtension.swift +10 -13
  79. package/Sources/Private/Utility/Primitives/VectorsExtensions.swift +28 -6
  80. package/Sources/Public/Animation/LottieAnimationHelpers.swift +12 -10
  81. package/Sources/Public/Animation/LottieAnimationView.swift +213 -186
  82. package/Sources/Public/DotLottie/DotLottieFile.swift +11 -34
  83. package/Sources/Public/DotLottie/DotLottieFileHelpers.swift +101 -74
  84. package/Sources/Public/iOS/Compatibility/CompatibleAnimationView.swift +90 -0
  85. package/Sources/Public/iOS/LottieAnimationViewBase.swift +1 -1
  86. package/Sources/Public/macOS/LottieAnimationViewBase.macOS.swift +1 -1
  87. package/lottie-ios.podspec +1 -1
  88. package/package.json +1 -1
  89. package/LottieAnimation/LottieAnimation.xcodeproj/project.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  90. package/LottieAnimation/LottieAnimation.xcodeproj/project.xcworkspace/xcuserdata/valentinperignon.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  91. package/LottieAnimation/LottieAnimation.xcodeproj/xcuserdata/calstephens.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  92. package/LottieAnimation/LottieAnimation.xcodeproj/xcuserdata/valentinperignon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  93. package/LottieAnimation/LottieAnimation.xcodeproj/xcuserdata/valentinperignon.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  94. package/Sources/Private/Model/DotLottie/Zip/Data+Compression.swift +0 -134
  95. package/Sources/Private/Model/DotLottie/Zip/FileManager+ZIP.swift +0 -130
  96. package/Sources/Private/Utility/Interpolatable/KeyframeGroup+Extensions.swift +0 -59
@@ -12,12 +12,12 @@
12
12
  <key>Lottie (macOS).xcscheme_^#shared#^_</key>
13
13
  <dict>
14
14
  <key>orderHint</key>
15
- <integer>4</integer>
15
+ <integer>3</integer>
16
16
  </dict>
17
17
  <key>Lottie (tvOS).xcscheme_^#shared#^_</key>
18
18
  <dict>
19
19
  <key>orderHint</key>
20
- <integer>5</integer>
20
+ <integer>4</integer>
21
21
  </dict>
22
22
  </dict>
23
23
  </dict>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <array/>
5
+ </plist>
@@ -68,5 +68,263 @@
68
68
  landmarkType = "7">
69
69
  </BreakpointContent>
70
70
  </BreakpointProxy>
71
+ <BreakpointProxy
72
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
73
+ <BreakpointContent
74
+ uuid = "F26C2C9A-5A5F-482E-9611-B74F8D65E1D9"
75
+ shouldBeEnabled = "Yes"
76
+ ignoreCount = "0"
77
+ continueAfterRunningActions = "No"
78
+ filePath = "Sources/Private/Utility/Extensions/DataExtension.swift"
79
+ startingColumnNumber = "9223372036854775807"
80
+ endingColumnNumber = "9223372036854775807"
81
+ startingLineNumber = "31"
82
+ endingLineNumber = "31"
83
+ landmarkName = "init(assetName:in:)"
84
+ landmarkType = "7">
85
+ </BreakpointContent>
86
+ </BreakpointProxy>
87
+ <BreakpointProxy
88
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
89
+ <BreakpointContent
90
+ uuid = "780F4614-9704-4CED-973D-AA8D154C4D4E"
91
+ shouldBeEnabled = "No"
92
+ ignoreCount = "0"
93
+ continueAfterRunningActions = "No"
94
+ filePath = "Sources/Private/CoreAnimation/Layers/ShapeLayer.swift"
95
+ startingColumnNumber = "9223372036854775807"
96
+ endingColumnNumber = "9223372036854775807"
97
+ startingLineNumber = "241"
98
+ endingLineNumber = "241"
99
+ landmarkName = "CALayer"
100
+ landmarkType = "21">
101
+ </BreakpointContent>
102
+ </BreakpointProxy>
103
+ <BreakpointProxy
104
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
105
+ <BreakpointContent
106
+ uuid = "7317D33F-83F7-487F-92D8-361AFDC3108F"
107
+ shouldBeEnabled = "No"
108
+ ignoreCount = "0"
109
+ continueAfterRunningActions = "No"
110
+ filePath = "Sources/Private/CoreAnimation/Layers/AnimationLayer.swift"
111
+ startingColumnNumber = "9223372036854775807"
112
+ endingColumnNumber = "9223372036854775807"
113
+ startingLineNumber = "59"
114
+ endingLineNumber = "59"
115
+ landmarkName = "addingKeypathComponent(_:)"
116
+ landmarkType = "7">
117
+ </BreakpointContent>
118
+ </BreakpointProxy>
119
+ <BreakpointProxy
120
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
121
+ <BreakpointContent
122
+ uuid = "4801815C-7DE8-430B-B7F8-900C71CB5F58"
123
+ shouldBeEnabled = "No"
124
+ condition = "customizableProperty.name.map { $0.rawValue } == [&quot;Position&quot;]"
125
+ ignoreCount = "0"
126
+ continueAfterRunningActions = "No"
127
+ filePath = "Sources/Private/CoreAnimation/Animations/CALayer+addAnimation.swift"
128
+ startingColumnNumber = "9223372036854775807"
129
+ endingColumnNumber = "9223372036854775807"
130
+ startingLineNumber = "105"
131
+ endingLineNumber = "105"
132
+ landmarkName = "CALayer"
133
+ landmarkType = "21">
134
+ <Locations>
135
+ <Location
136
+ uuid = "4801815C-7DE8-430B-B7F8-900C71CB5F58 - a53351c05a040cfb"
137
+ shouldBeEnabled = "Yes"
138
+ ignoreCount = "0"
139
+ continueAfterRunningActions = "No"
140
+ symbolName = "__C.CALayer.customizedAnimation&lt;&#x3c4;_0_0&gt;(for: Lottie.LayerProperty&lt;&#x3c4;_0_0&gt;, context: Lottie.LayerAnimationContext) throws -&gt; Swift.Optional&lt;__C.CAPropertyAnimation&gt;"
141
+ moduleName = "Lottie"
142
+ usesParentBreakpointCondition = "Yes"
143
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Animations/CALayer+addAnimation.swift"
144
+ startingColumnNumber = "9223372036854775807"
145
+ endingColumnNumber = "9223372036854775807"
146
+ startingLineNumber = "106"
147
+ endingLineNumber = "106"
148
+ offsetFromSymbolStart = "156">
149
+ </Location>
150
+ <Location
151
+ uuid = "4801815C-7DE8-430B-B7F8-900C71CB5F58 - a53351c05a040cfb"
152
+ shouldBeEnabled = "Yes"
153
+ ignoreCount = "0"
154
+ continueAfterRunningActions = "No"
155
+ symbolName = "__C.CALayer.customizedAnimation&lt;&#x3c4;_0_0&gt;(for: Lottie.LayerProperty&lt;&#x3c4;_0_0&gt;, context: Lottie.LayerAnimationContext) throws -&gt; Swift.Optional&lt;__C.CAPropertyAnimation&gt;"
156
+ moduleName = "Lottie"
157
+ usesParentBreakpointCondition = "Yes"
158
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Animations/CALayer+addAnimation.swift"
159
+ startingColumnNumber = "9223372036854775807"
160
+ endingColumnNumber = "9223372036854775807"
161
+ startingLineNumber = "106"
162
+ endingLineNumber = "106"
163
+ offsetFromSymbolStart = "220">
164
+ </Location>
165
+ </Locations>
166
+ </BreakpointContent>
167
+ </BreakpointProxy>
168
+ <BreakpointProxy
169
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
170
+ <BreakpointContent
171
+ uuid = "F52F692F-1F08-4469-8EE8-C10D7FC89847"
172
+ shouldBeEnabled = "No"
173
+ condition = "context.currentKeypath.fullPath.contains(&quot;Group 1&quot;)"
174
+ ignoreCount = "0"
175
+ continueAfterRunningActions = "No"
176
+ filePath = "Sources/Private/CoreAnimation/Layers/ShapeItemLayer.swift"
177
+ startingColumnNumber = "9223372036854775807"
178
+ endingColumnNumber = "9223372036854775807"
179
+ startingLineNumber = "342"
180
+ endingLineNumber = "342"
181
+ landmarkName = "`for`(_:)"
182
+ landmarkType = "7">
183
+ </BreakpointContent>
184
+ </BreakpointProxy>
185
+ <BreakpointProxy
186
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
187
+ <BreakpointContent
188
+ uuid = "A8A829E3-8C9D-40A2-96C0-111C9B6F69B9"
189
+ shouldBeEnabled = "No"
190
+ ignoreCount = "0"
191
+ continueAfterRunningActions = "No"
192
+ filePath = "Sources/Private/CoreAnimation/Animations/LayerProperty.swift"
193
+ startingColumnNumber = "9223372036854775807"
194
+ endingColumnNumber = "9223372036854775807"
195
+ startingLineNumber = "306"
196
+ endingLineNumber = "306"
197
+ landmarkName = "rotation"
198
+ landmarkType = "24">
199
+ <Locations>
200
+ <Location
201
+ uuid = "A8A829E3-8C9D-40A2-96C0-111C9B6F69B9 - 6c551e311a4aacb0"
202
+ shouldBeEnabled = "Yes"
203
+ ignoreCount = "0"
204
+ continueAfterRunningActions = "No"
205
+ symbolName = "closure #1 (Any) -&gt; Swift.Optional&lt;CoreGraphics.CGFloat&gt; in static Lottie.CustomizableProperty.scaleY.getter : Lottie.CustomizableProperty&lt;CoreGraphics.CGFloat&gt;"
206
+ moduleName = "Lottie"
207
+ usesParentBreakpointCondition = "Yes"
208
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Animations/LayerProperty.swift"
209
+ startingColumnNumber = "9223372036854775807"
210
+ endingColumnNumber = "9223372036854775807"
211
+ startingLineNumber = "292"
212
+ endingLineNumber = "292"
213
+ offsetFromSymbolStart = "296">
214
+ </Location>
215
+ <Location
216
+ uuid = "A8A829E3-8C9D-40A2-96C0-111C9B6F69B9 - 6c551e311a4aacb0"
217
+ shouldBeEnabled = "Yes"
218
+ ignoreCount = "0"
219
+ continueAfterRunningActions = "No"
220
+ symbolName = "closure #1 (Any) -&gt; Swift.Optional&lt;CoreGraphics.CGFloat&gt; in static Lottie.CustomizableProperty.scaleY.getter : Lottie.CustomizableProperty&lt;CoreGraphics.CGFloat&gt;"
221
+ moduleName = "Lottie"
222
+ usesParentBreakpointCondition = "Yes"
223
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Animations/LayerProperty.swift"
224
+ startingColumnNumber = "9223372036854775807"
225
+ endingColumnNumber = "9223372036854775807"
226
+ startingLineNumber = "292"
227
+ endingLineNumber = "292"
228
+ offsetFromSymbolStart = "344">
229
+ </Location>
230
+ </Locations>
231
+ </BreakpointContent>
232
+ </BreakpointProxy>
233
+ <BreakpointProxy
234
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
235
+ <BreakpointContent
236
+ uuid = "083F77B7-FF28-4132-ADBB-D0EA9B91C736"
237
+ shouldBeEnabled = "No"
238
+ ignoreCount = "0"
239
+ continueAfterRunningActions = "No"
240
+ filePath = "Sources/Private/CoreAnimation/Animations/LayerProperty.swift"
241
+ startingColumnNumber = "9223372036854775807"
242
+ endingColumnNumber = "9223372036854775807"
243
+ startingLineNumber = "293"
244
+ endingLineNumber = "293"
245
+ landmarkName = "scaleY"
246
+ landmarkType = "24">
247
+ <Locations>
248
+ <Location
249
+ uuid = "083F77B7-FF28-4132-ADBB-D0EA9B91C736 - 6c551e311a4ab35d"
250
+ shouldBeEnabled = "Yes"
251
+ ignoreCount = "0"
252
+ continueAfterRunningActions = "No"
253
+ symbolName = "closure #1 (Any) -&gt; Swift.Optional&lt;CoreGraphics.CGFloat&gt; in static Lottie.CustomizableProperty.scaleX.getter : Lottie.CustomizableProperty&lt;CoreGraphics.CGFloat&gt;"
254
+ moduleName = "Lottie"
255
+ usesParentBreakpointCondition = "Yes"
256
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Animations/LayerProperty.swift"
257
+ startingColumnNumber = "9223372036854775807"
258
+ endingColumnNumber = "9223372036854775807"
259
+ startingLineNumber = "279"
260
+ endingLineNumber = "279"
261
+ offsetFromSymbolStart = "296">
262
+ </Location>
263
+ <Location
264
+ uuid = "083F77B7-FF28-4132-ADBB-D0EA9B91C736 - 6c551e311a4ab35d"
265
+ shouldBeEnabled = "Yes"
266
+ ignoreCount = "0"
267
+ continueAfterRunningActions = "No"
268
+ symbolName = "closure #1 (Any) -&gt; Swift.Optional&lt;CoreGraphics.CGFloat&gt; in static Lottie.CustomizableProperty.scaleX.getter : Lottie.CustomizableProperty&lt;CoreGraphics.CGFloat&gt;"
269
+ moduleName = "Lottie"
270
+ usesParentBreakpointCondition = "Yes"
271
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Animations/LayerProperty.swift"
272
+ startingColumnNumber = "9223372036854775807"
273
+ endingColumnNumber = "9223372036854775807"
274
+ startingLineNumber = "279"
275
+ endingLineNumber = "279"
276
+ offsetFromSymbolStart = "344">
277
+ </Location>
278
+ </Locations>
279
+ </BreakpointContent>
280
+ </BreakpointProxy>
281
+ <BreakpointProxy
282
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
283
+ <BreakpointContent
284
+ uuid = "232AD61E-2983-4DD6-A6D6-721AA2D12700"
285
+ shouldBeEnabled = "No"
286
+ ignoreCount = "0"
287
+ continueAfterRunningActions = "No"
288
+ filePath = "Sources/Private/CoreAnimation/Animations/LayerProperty.swift"
289
+ startingColumnNumber = "9223372036854775807"
290
+ endingColumnNumber = "9223372036854775807"
291
+ startingLineNumber = "305"
292
+ endingLineNumber = "305"
293
+ landmarkName = "rotation"
294
+ landmarkType = "24">
295
+ </BreakpointContent>
296
+ </BreakpointProxy>
297
+ <BreakpointProxy
298
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
299
+ <BreakpointContent
300
+ uuid = "DE9A3966-371D-4974-992F-6F20AF21055B"
301
+ shouldBeEnabled = "No"
302
+ ignoreCount = "0"
303
+ continueAfterRunningActions = "No"
304
+ filePath = "Sources/Private/CoreAnimation/Animations/StrokeAnimation.swift"
305
+ startingColumnNumber = "9223372036854775807"
306
+ endingColumnNumber = "9223372036854775807"
307
+ startingLineNumber = "73"
308
+ endingLineNumber = "73"
309
+ landmarkName = "addStrokeAnimations(for:context:)"
310
+ landmarkType = "7">
311
+ </BreakpointContent>
312
+ </BreakpointProxy>
313
+ <BreakpointProxy
314
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
315
+ <BreakpointContent
316
+ uuid = "B61AB02D-FB91-45DD-BAA4-59D15A088394"
317
+ shouldBeEnabled = "No"
318
+ ignoreCount = "0"
319
+ continueAfterRunningActions = "No"
320
+ filePath = "Sources/Private/CoreAnimation/Animations/ShapeAnimation.swift"
321
+ startingColumnNumber = "9223372036854775807"
322
+ endingColumnNumber = "9223372036854775807"
323
+ startingLineNumber = "116"
324
+ endingLineNumber = "116"
325
+ landmarkName = "Trim"
326
+ landmarkType = "21">
327
+ </BreakpointContent>
328
+ </BreakpointProxy>
71
329
  </Breakpoints>
72
330
  </Bucket>
@@ -105,6 +105,17 @@
105
105
  <ContextState
106
106
  contextName = "GroupLayer.init(group:items:groupPath:context:):ShapeLayer.swift">
107
107
  </ContextState>
108
+ <ContextState
109
+ contextName = "RoundedCornersNode.rebuildOutputs(frame:):RoundedCornersNode.swift">
110
+ <PersistentStrings>
111
+ <PersistentString
112
+ value = "path">
113
+ </PersistentString>
114
+ <PersistentString
115
+ value = "UIBezierPath(cgPath: path.roundCorners(radius: 2).paths[0].cgPath())">
116
+ </PersistentString>
117
+ </PersistentStrings>
118
+ </ContextState>
108
119
  <ContextState
109
120
  contextName = "CALayer.addTransformAnimations(for:context:):TransformAnimations.swift">
110
121
  </ContextState>
@@ -118,10 +129,10 @@
118
129
  contextName = "CoreAnimationLayer.display():CoreAnimationLayer.swift">
119
130
  <PersistentStrings>
120
131
  <PersistentString
121
- value = "(superlayer!.delegate! as! UIView).superview!">
132
+ value = "(superlayer!.delegate! as! UIView).window">
122
133
  </PersistentString>
123
134
  <PersistentString
124
- value = "(superlayer!.delegate! as! UIView).window">
135
+ value = "(superlayer!.delegate! as! UIView).superview!">
125
136
  </PersistentString>
126
137
  </PersistentStrings>
127
138
  </ContextState>
package/Package.swift CHANGED
@@ -3,7 +3,8 @@ import PackageDescription
3
3
 
4
4
  let package = Package(
5
5
  name: "Lottie",
6
- platforms: [.iOS("11.0"), .macOS("10.10"), .tvOS("11.0")],
6
+ // Minimum platform versions should be kept in sync with the per-platform targets in Lottie.xcodeproj and lottie-ios.podspec
7
+ platforms: [.iOS("11.0"), .macOS("10.11"), .tvOS("11.0")],
7
8
  products: [.library(name: "Lottie", targets: ["Lottie"])],
8
9
  targets: [.target(name: "Lottie", path: "Sources")])
9
10
 
package/README.md CHANGED
@@ -8,7 +8,7 @@ Lottie is a cross-platform library for iOS, macOS, tvOS, [Android](https://githu
8
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.haiku.ai).
9
9
 
10
10
  Designers can create **and ship** beautiful animations without an engineer painstakingly recreating them by hand.
11
- Since the animation is backed by JSON they are extremely small in size but can be large in complexity!
11
+ Since the animations are backed by JSON, they are extremely small in size but can be large in complexity!
12
12
  Animations can be played, resized, looped, sped up, slowed down, reversed, and even interactively scrubbed.
13
13
  Lottie can play or loop just a portion of the animation as well, the possibilities are endless!
14
14
  Animations can even be ***changed at runtime*** in various ways! Change the color, position, or any keyframable value!
@@ -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.1.2")
44
+ .package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.2.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.
@@ -88,7 +88,7 @@ We always appreciate contributions from the community. To make changes to the pr
88
88
 
89
89
  All pull requests with new features or bug fixes that affect how animations render should include snapshot test cases that validate the included changes.
90
90
  - To add a new sample animation to the snapshot testing suite, you can add the `.json` file to `Tests/Samples`. Re-run the snapshot tests to generate the new snapshot image files.
91
- - To update existing snapshots after making changes, you can set `isRecording = true` in `SnapshotTests.swift` and then re-run the snapshot tests.
91
+ - To update existing snapshots after making changes, you can set `isRecording = true` in `SnapshotTests.swift` `setUp()` method and then re-run the snapshot tests.
92
92
 
93
93
  The project also includes several helpful commands defined in our [Rakefile](https://github.com/airbnb/lottie-ios/blob/master/Rakefile). To use these, you need to install [Bundler](https://bundler.io/):
94
94
 
package/Rakefile CHANGED
@@ -30,7 +30,7 @@ namespace :build do
30
30
 
31
31
  desc 'Builds the iOS Lottie Example app'
32
32
  task :iOS do
33
- xcodebuild('build -scheme "Example (iOS)" -destination "platform=iOS Simulator,name=iPhone 8" -workspace Lottie.xcworkspace')
33
+ xcodebuild('build -scheme "Example (iOS)" -destination "platform=iOS Simulator,name=iPhone SE (3rd generation)" -workspace Lottie.xcworkspace')
34
34
  end
35
35
 
36
36
  desc 'Builds the macOS Lottie Example app'
@@ -49,6 +49,7 @@ namespace :build do
49
49
  sh 'rm -rf .build/archives'
50
50
  xcodebuild('archive -workspace Lottie.xcworkspace -scheme "Lottie (iOS)" -destination generic/platform=iOS -archivePath ".build/archives/Lottie_iOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES')
51
51
  xcodebuild('archive -workspace Lottie.xcworkspace -scheme "Lottie (iOS)" -destination "generic/platform=iOS Simulator" -archivePath ".build/archives/Lottie_iOS_Simulator" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES')
52
+ xcodebuild('archive -workspace Lottie.xcworkspace -scheme "Lottie (iOS)" -destination "generic/platform=macOS,variant=Mac Catalyst" -archivePath ".build/archives/Lottie_Mac_Catalyst" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES')
52
53
  xcodebuild('archive -workspace Lottie.xcworkspace -scheme "Lottie (macOS)" -destination generic/platform=macOS -archivePath ".build/archives/Lottie_macOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES')
53
54
  xcodebuild('archive -workspace Lottie.xcworkspace -scheme "Lottie (tvOS)" -destination generic/platform=tvOS -archivePath ".build/archives/Lottie_tvOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES')
54
55
  xcodebuild('archive -workspace Lottie.xcworkspace -scheme "Lottie (tvOS)" -destination "generic/platform=tvOS Simulator" -archivePath ".build/archives/Lottie_tvOS_Simulator" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES')
@@ -57,13 +58,16 @@ namespace :build do
57
58
  '-create-xcframework',
58
59
  '-framework .build/archives/Lottie_iOS.xcarchive/Products/Library/Frameworks/Lottie.framework',
59
60
  '-framework .build/archives/Lottie_iOS_Simulator.xcarchive/Products/Library/Frameworks/Lottie.framework',
61
+ '-framework .build/archives/Lottie_Mac_Catalyst.xcarchive/Products/Library/Frameworks/Lottie.framework',
60
62
  '-framework .build/archives/Lottie_macOS.xcarchive/Products/Library/Frameworks/Lottie.framework',
61
63
  '-framework .build/archives/Lottie_tvOS.xcarchive/Products/Library/Frameworks/Lottie.framework',
62
64
  '-framework .build/archives/Lottie_tvOS_Simulator.xcarchive/Products/Library/Frameworks/Lottie.framework',
63
65
  '-output .build/archives/Lottie.xcframework'
64
66
  ].join(" "))
65
67
  Dir.chdir('.build/archives') do
66
- sh 'zip -r Lottie.xcframework.zip Lottie.xcframework'
68
+ # Use --symlinks to avoid "Multiple binaries share the same codesign path. This can happen if your build process copies frameworks by following symlinks."
69
+ # error when validating macOS apps (#1948)
70
+ sh 'zip -r --symlinks Lottie.xcframework.zip Lottie.xcframework'
67
71
  sh 'rm -rf Lottie.xcframework'
68
72
  end
69
73
  sh 'swift package compute-checksum .build/archives/Lottie.xcframework.zip'
@@ -74,7 +78,7 @@ namespace :test do
74
78
  desc 'Tests the Lottie package for iOS'
75
79
  task :package do
76
80
  sh 'rm -rf Tests/Artifacts'
77
- xcodebuild('test -scheme "Lottie (iOS)" -destination "platform=iOS Simulator,name=iPhone 8" -resultBundlePath Tests/Artifacts/LottieTests.xcresult')
81
+ xcodebuild('test -scheme "Lottie (iOS)" -destination "platform=iOS Simulator,name=iPhone SE (3rd generation)" -resultBundlePath Tests/Artifacts/LottieTests.xcresult')
78
82
  end
79
83
 
80
84
  desc 'Processes .xcresult artifacts from the most recent test:package execution'
@@ -99,7 +103,7 @@ namespace :test do
99
103
  sh 'rm -rf ~/Library/Caches/org.carthage.CarthageKit/DerivedData'
100
104
 
101
105
  # Build a test app that imports and uses the LottieCarthage framework
102
- xcodebuild('build -scheme CarthageTest -destination "platform=iOS Simulator,name=iPhone 8"')
106
+ xcodebuild('build -scheme CarthageTest -destination "platform=iOS Simulator,name=iPhone SE (3rd generation)"')
103
107
  xcodebuild('build -scheme CarthageTest-macOS')
104
108
  end
105
109
  end
@@ -12,7 +12,7 @@ extension CALayer {
12
12
  @nonobjc
13
13
  func addAnimation<KeyframeValue, ValueRepresentation>(
14
14
  for property: LayerProperty<ValueRepresentation>,
15
- keyframes: ContiguousArray<Keyframe<KeyframeValue>>,
15
+ keyframes: KeyframeGroup<KeyframeValue>,
16
16
  value keyframeValueMapping: (KeyframeValue) throws -> ValueRepresentation,
17
17
  context: LayerAnimationContext)
18
18
  throws
@@ -41,13 +41,27 @@ extension CALayer {
41
41
  @nonobjc
42
42
  private func defaultAnimation<KeyframeValue, ValueRepresentation>(
43
43
  for property: LayerProperty<ValueRepresentation>,
44
- keyframes: ContiguousArray<Keyframe<KeyframeValue>>,
44
+ keyframes keyframeGroup: KeyframeGroup<KeyframeValue>,
45
45
  value keyframeValueMapping: (KeyframeValue) throws -> ValueRepresentation,
46
46
  context: LayerAnimationContext)
47
47
  throws -> CAAnimation?
48
48
  {
49
+ let keyframes = keyframeGroup.keyframes
49
50
  guard !keyframes.isEmpty else { return nil }
50
51
 
52
+ // Check if this set of keyframes uses After Effects expressions, which aren't supported.
53
+ if let unsupportedAfterEffectsExpression = keyframeGroup.unsupportedAfterEffectsExpression {
54
+ context.logger.info("""
55
+ `\(property.caLayerKeypath)` animation for "\(context.currentKeypath.fullPath)" \
56
+ includes an After Effects expression (https://helpx.adobe.com/after-effects/using/expression-language.html), \
57
+ which is not supported by lottie-ios (expressions are only supported by lottie-web). \
58
+ This animation may not play correctly.
59
+
60
+ \(unsupportedAfterEffectsExpression.replacingOccurrences(of: "\n", with: "\n "))
61
+
62
+ """)
63
+ }
64
+
51
65
  // If there is exactly one keyframe value, we can improve performance
52
66
  // by applying that value directly to the layer instead of creating
53
67
  // a relatively expensive `CAKeyframeAnimation`.
@@ -14,7 +14,7 @@ extension CAShapeLayer {
14
14
  {
15
15
  try addAnimation(
16
16
  for: .path,
17
- keyframes: combinedShapes.shapes.keyframes,
17
+ keyframes: combinedShapes.shapes,
18
18
  value: { paths in
19
19
  let combinedPath = CGMutablePath()
20
20
  for path in paths {
@@ -20,7 +20,7 @@ extension CAShapeLayer {
20
20
 
21
21
  try addAnimation(
22
22
  for: .path,
23
- keyframes: combinedKeyframes.keyframes,
23
+ keyframes: combinedKeyframes,
24
24
  value: { pathKeyframe in
25
25
  var path = pathKeyframe.path
26
26
  if let cornerRadius = pathKeyframe.cornerRadius {
@@ -14,7 +14,7 @@ extension CAShapeLayer {
14
14
  {
15
15
  try addAnimation(
16
16
  for: .path,
17
- keyframes: ellipse.combinedKeyframes().keyframes,
17
+ keyframes: ellipse.combinedKeyframes(),
18
18
  value: { keyframe in
19
19
  BezierPath.ellipse(
20
20
  size: keyframe.size.sizeValue,
@@ -57,7 +57,7 @@ extension GradientRenderLayer {
57
57
 
58
58
  try addAnimation(
59
59
  for: .colors,
60
- keyframes: gradient.colors.keyframes,
60
+ keyframes: gradient.colors,
61
61
  value: { colorComponents in
62
62
  gradient.colorConfiguration(from: colorComponents, type: type).map { $0.color }
63
63
  },
@@ -65,7 +65,7 @@ extension GradientRenderLayer {
65
65
 
66
66
  try addAnimation(
67
67
  for: .locations,
68
- keyframes: gradient.colors.keyframes,
68
+ keyframes: gradient.colors,
69
69
  value: { colorComponents in
70
70
  gradient.colorConfiguration(from: colorComponents, type: type).map { $0.location }
71
71
  },
@@ -94,7 +94,7 @@ extension GradientRenderLayer {
94
94
 
95
95
  try addAnimation(
96
96
  for: .startPoint,
97
- keyframes: gradient.startPoint.keyframes,
97
+ keyframes: gradient.startPoint,
98
98
  value: { absoluteStartPoint in
99
99
  percentBasedPointInBounds(from: absoluteStartPoint.pointValue)
100
100
  },
@@ -102,7 +102,7 @@ extension GradientRenderLayer {
102
102
 
103
103
  try addAnimation(
104
104
  for: .endPoint,
105
- keyframes: gradient.endPoint.keyframes,
105
+ keyframes: gradient.endPoint,
106
106
  value: { absoluteEndPoint in
107
107
  percentBasedPointInBounds(from: absoluteEndPoint.pointValue)
108
108
  },
@@ -128,13 +128,13 @@ extension GradientRenderLayer {
128
128
 
129
129
  try addAnimation(
130
130
  for: .startPoint,
131
- keyframes: combinedKeyframes.keyframes,
131
+ keyframes: combinedKeyframes,
132
132
  value: \.startPoint,
133
133
  context: context)
134
134
 
135
135
  try addAnimation(
136
136
  for: .endPoint,
137
- keyframes: combinedKeyframes.keyframes,
137
+ keyframes: combinedKeyframes,
138
138
  value: \.endPoint,
139
139
  context: context)
140
140
  }