lottie-ios 4.3.3 → 4.3.4

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 (38) hide show
  1. package/Lottie.xcodeproj/project.pbxproj +20 -0
  2. package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  3. package/Lottie.xcworkspace/xcuserdata/calstephens.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +138 -124
  4. package/Package.swift +1 -0
  5. package/README.md +1 -1
  6. package/Sources/Private/CoreAnimation/Layers/ShapeLayer.swift +98 -30
  7. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIHostingController.swift +1 -1
  8. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIHostingView.swift +1 -3
  9. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +2 -0
  10. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +2 -0
  11. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +2 -0
  12. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +2 -0
  13. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +2 -0
  14. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +2 -0
  15. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +2 -0
  16. package/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +2 -0
  17. package/Sources/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +2 -1
  18. package/Sources/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +256 -0
  19. package/Sources/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
  20. package/Sources/Private/EmbeddedLibraries/README.md +14 -0
  21. package/Sources/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +11 -5
  22. package/Sources/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +0 -1
  23. package/Sources/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +5 -2
  24. package/Sources/Private/Model/LayerEffects/EffectValues/EffectValue.swift +2 -2
  25. package/Sources/Private/Model/Layers/LayerModel.swift +5 -0
  26. package/Sources/Private/Utility/Helpers/Binding+Map.swift +2 -0
  27. package/Sources/Private/Utility/Helpers/View+ValueChanged.swift +2 -0
  28. package/Sources/Public/Animation/LottieAnimationLayer.swift +1 -0
  29. package/Sources/Public/Animation/LottieAnimationView.swift +12 -1
  30. package/Sources/Public/Animation/LottieView.swift +2 -0
  31. package/Sources/Public/AnimationCache/DefaultAnimationCache.swift +10 -6
  32. package/Sources/Public/Controls/LottieButton.swift +2 -1
  33. package/Sources/Public/Controls/LottieSwitch.swift +2 -0
  34. package/Sources/Public/DotLottie/Cache/DotLottieCache.swift +8 -4
  35. package/Sources/Public/DotLottie/DotLottieFileHelpers.swift +12 -5
  36. package/Sources/Public/iOS/LottieAnimationViewBase.swift +5 -2
  37. package/lottie-ios.podspec +2 -1
  38. package/package.json +1 -1
@@ -340,6 +340,10 @@
340
340
  08AB055D2A61C5CC00DE86FD /* RenderingEngineOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AB055C2A61C5CC00DE86FD /* RenderingEngineOption.swift */; };
341
341
  08AB055E2A61C5CC00DE86FD /* RenderingEngineOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AB055C2A61C5CC00DE86FD /* RenderingEngineOption.swift */; };
342
342
  08AB055F2A61C5CC00DE86FD /* RenderingEngineOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AB055C2A61C5CC00DE86FD /* RenderingEngineOption.swift */; };
343
+ 08BCA8472B0E8E0B00594EEB /* LRUCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08BCA8452B0E8E0B00594EEB /* LRUCache.swift */; };
344
+ 08BCA8482B0E8E0B00594EEB /* LRUCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08BCA8452B0E8E0B00594EEB /* LRUCache.swift */; };
345
+ 08BCA8492B0E8E0B00594EEB /* LRUCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08BCA8452B0E8E0B00594EEB /* LRUCache.swift */; };
346
+ 08BCA84A2B0E8E0B00594EEB /* LRUCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08BCA8452B0E8E0B00594EEB /* LRUCache.swift */; };
343
347
  08C001F32A46150D00AB54BA /* Archive+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08C001E02A46150D00AB54BA /* Archive+Helpers.swift */; };
344
348
  08C001F42A46150D00AB54BA /* Archive+MemoryFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08C001E12A46150D00AB54BA /* Archive+MemoryFile.swift */; };
345
349
  08C001F52A46150D00AB54BA /* Archive+BackingConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08C001E22A46150D00AB54BA /* Archive+BackingConfiguration.swift */; };
@@ -1181,6 +1185,8 @@
1181
1185
  08AB05542A61C20400DE86FD /* ReducedMotionOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReducedMotionOption.swift; sourceTree = "<group>"; };
1182
1186
  08AB05582A61C5B700DE86FD /* DecodingStrategy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecodingStrategy.swift; sourceTree = "<group>"; };
1183
1187
  08AB055C2A61C5CC00DE86FD /* RenderingEngineOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenderingEngineOption.swift; sourceTree = "<group>"; };
1188
+ 08BCA8452B0E8E0B00594EEB /* LRUCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LRUCache.swift; sourceTree = "<group>"; };
1189
+ 08BCA8462B0E8E0B00594EEB /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
1184
1190
  08C001E02A46150D00AB54BA /* Archive+Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Archive+Helpers.swift"; sourceTree = "<group>"; };
1185
1191
  08C001E12A46150D00AB54BA /* Archive+MemoryFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Archive+MemoryFile.swift"; sourceTree = "<group>"; };
1186
1192
  08C001E22A46150D00AB54BA /* Archive+BackingConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Archive+BackingConfiguration.swift"; sourceTree = "<group>"; };
@@ -1553,12 +1559,22 @@
1553
1559
  path = Configuration;
1554
1560
  sourceTree = "<group>";
1555
1561
  };
1562
+ 08BCA8442B0E8E0B00594EEB /* LRUCache */ = {
1563
+ isa = PBXGroup;
1564
+ children = (
1565
+ 08BCA8452B0E8E0B00594EEB /* LRUCache.swift */,
1566
+ 08BCA8462B0E8E0B00594EEB /* README.md */,
1567
+ );
1568
+ path = LRUCache;
1569
+ sourceTree = "<group>";
1570
+ };
1556
1571
  08C001DE2A4614CF00AB54BA /* EmbeddedLibraries */ = {
1557
1572
  isa = PBXGroup;
1558
1573
  children = (
1559
1574
  08C002062A46152200AB54BA /* README.md */,
1560
1575
  08C0021E2A46166400AB54BA /* EpoxyCore */,
1561
1576
  08C001DF2A46150D00AB54BA /* ZipFoundation */,
1577
+ 08BCA8442B0E8E0B00594EEB /* LRUCache */,
1562
1578
  );
1563
1579
  path = EmbeddedLibraries;
1564
1580
  sourceTree = "<group>";
@@ -2876,6 +2892,7 @@
2876
2892
  080DEFFE2A95712400BE2D96 /* GradientAnimations.swift in Sources */,
2877
2893
  080DF03C2A95715900BE2D96 /* Star.swift in Sources */,
2878
2894
  080DEFD32A95711400BE2D96 /* Entry+Serialization.swift in Sources */,
2895
+ 08BCA84A2B0E8E0B00594EEB /* LRUCache.swift in Sources */,
2879
2896
  080DF01D2A95713B00BE2D96 /* StarNode.swift in Sources */,
2880
2897
  080DEFB02A9570FE00BE2D96 /* AnimatedProviding.swift in Sources */,
2881
2898
  080DEFC72A95710F00BE2D96 /* EpoxyableView.swift in Sources */,
@@ -3175,6 +3192,7 @@
3175
3192
  2E9C96242822F43100677516 /* KeyframeGroup.swift in Sources */,
3176
3193
  2E9C96FF2822F43100677516 /* BaseAnimationLayer.swift in Sources */,
3177
3194
  08E206F72A56014E002DCE17 /* Collection+Diff.swift in Sources */,
3195
+ 08BCA8472B0E8E0B00594EEB /* LRUCache.swift in Sources */,
3178
3196
  08C001F62A46150D00AB54BA /* Archive.swift in Sources */,
3179
3197
  2E9C96AB2822F43100677516 /* GradientStrokeNode.swift in Sources */,
3180
3198
  08E2071B2A56014E002DCE17 /* EpoxySwiftUIHostingView.swift in Sources */,
@@ -3488,6 +3506,7 @@
3488
3506
  2EAF5AC327A0798700E00531 /* BundleImageProvider.swift in Sources */,
3489
3507
  08AB055A2A61C5B700DE86FD /* DecodingStrategy.swift in Sources */,
3490
3508
  08E207492A56014E002DCE17 /* AnimatedProviding.swift in Sources */,
3509
+ 08BCA8482B0E8E0B00594EEB /* LRUCache.swift in Sources */,
3491
3510
  2E9C976C2822F43100677516 /* InterpolatableExtensions.swift in Sources */,
3492
3511
  2E9C96EE2822F43100677516 /* ShapeItemLayer.swift in Sources */,
3493
3512
  08C002D62A46196300AB54BA /* Data+CompressionDeprecated.swift in Sources */,
@@ -3775,6 +3794,7 @@
3775
3794
  2E9C97012822F43100677516 /* BaseAnimationLayer.swift in Sources */,
3776
3795
  2E9C96AD2822F43100677516 /* GradientStrokeNode.swift in Sources */,
3777
3796
  08E206F92A56014E002DCE17 /* Collection+Diff.swift in Sources */,
3797
+ 08BCA8492B0E8E0B00594EEB /* LRUCache.swift in Sources */,
3778
3798
  2EAF5AC427A0798700E00531 /* BundleImageProvider.swift in Sources */,
3779
3799
  08E2071D2A56014E002DCE17 /* EpoxySwiftUIHostingView.swift in Sources */,
3780
3800
  2E9C976D2822F43100677516 /* InterpolatableExtensions.swift in Sources */,
@@ -134,69 +134,6 @@
134
134
  landmarkType = "21">
135
135
  </BreakpointContent>
136
136
  </BreakpointProxy>
137
- <BreakpointProxy
138
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
139
- <BreakpointContent
140
- uuid = "F1C4DA17-6BE2-4FBD-A917-AAB0466350C6"
141
- shouldBeEnabled = "No"
142
- ignoreCount = "0"
143
- continueAfterRunningActions = "No"
144
- filePath = "Sources/Private/CoreAnimation/Layers/PreCompLayer.swift"
145
- startingColumnNumber = "9223372036854775807"
146
- endingColumnNumber = "9223372036854775807"
147
- startingLineNumber = "54"
148
- endingLineNumber = "54"
149
- landmarkName = "setup(context:)"
150
- landmarkType = "7">
151
- <Locations>
152
- <Location
153
- uuid = "F1C4DA17-6BE2-4FBD-A917-AAB0466350C6 - d485919a3415bc3f"
154
- shouldBeEnabled = "Yes"
155
- ignoreCount = "0"
156
- continueAfterRunningActions = "No"
157
- symbolName = "Lottie.PreCompLayer.setup(context: Lottie.LayerContext) throws -&gt; ()"
158
- moduleName = "Lottie"
159
- usesParentBreakpointCondition = "Yes"
160
- urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Layers/PreCompLayer.swift"
161
- startingColumnNumber = "9223372036854775807"
162
- endingColumnNumber = "9223372036854775807"
163
- startingLineNumber = "54"
164
- endingLineNumber = "54"
165
- offsetFromSymbolStart = "320">
166
- </Location>
167
- <Location
168
- uuid = "F1C4DA17-6BE2-4FBD-A917-AAB0466350C6 - d485919a3415a337"
169
- shouldBeEnabled = "Yes"
170
- ignoreCount = "0"
171
- continueAfterRunningActions = "No"
172
- symbolName = "Lottie.PreCompLayer.setup(context: Lottie.LayerContext) throws -&gt; ()"
173
- moduleName = "Lottie"
174
- usesParentBreakpointCondition = "Yes"
175
- urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Layers/PreCompLayer.swift"
176
- startingColumnNumber = "9223372036854775807"
177
- endingColumnNumber = "9223372036854775807"
178
- startingLineNumber = "62"
179
- endingLineNumber = "62"
180
- offsetFromSymbolStart = "84">
181
- </Location>
182
- <Location
183
- uuid = "F1C4DA17-6BE2-4FBD-A917-AAB0466350C6 - d485919a3415a337"
184
- shouldBeEnabled = "Yes"
185
- ignoreCount = "0"
186
- continueAfterRunningActions = "No"
187
- symbolName = "Lottie.PreCompLayer.setup(context: Lottie.LayerContext) throws -&gt; ()"
188
- moduleName = "Lottie"
189
- usesParentBreakpointCondition = "Yes"
190
- urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/CoreAnimation/Layers/PreCompLayer.swift"
191
- startingColumnNumber = "9223372036854775807"
192
- endingColumnNumber = "9223372036854775807"
193
- startingLineNumber = "62"
194
- endingLineNumber = "62"
195
- offsetFromSymbolStart = "172">
196
- </Location>
197
- </Locations>
198
- </BreakpointContent>
199
- </BreakpointProxy>
200
137
  <BreakpointProxy
201
138
  BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
202
139
  <BreakpointContent
@@ -317,6 +254,21 @@
317
254
  endingLineNumber = "412"
318
255
  offsetFromSymbolStart = "99">
319
256
  </Location>
257
+ <Location
258
+ uuid = "E5D4F221-8220-42A8-BB35-32D5BEE1328B - 88a2ef8955d88ff5"
259
+ shouldBeEnabled = "Yes"
260
+ ignoreCount = "0"
261
+ continueAfterRunningActions = "No"
262
+ symbolName = "__C.UIView.systemLayoutFittingIntrinsicWidthFixedHeight(_: CoreGraphics.CGFloat, priority: __C.UILayoutPriority) -&gt; __C.CGSize"
263
+ moduleName = "Example (Multiplatform)"
264
+ usesParentBreakpointCondition = "Yes"
265
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift"
266
+ startingColumnNumber = "9223372036854775807"
267
+ endingColumnNumber = "9223372036854775807"
268
+ startingLineNumber = "411"
269
+ endingLineNumber = "411"
270
+ offsetFromSymbolStart = "107">
271
+ </Location>
320
272
  </Locations>
321
273
  </BreakpointContent>
322
274
  </BreakpointProxy>
@@ -456,6 +408,21 @@
456
408
  endingLineNumber = "393"
457
409
  offsetFromSymbolStart = "97">
458
410
  </Location>
411
+ <Location
412
+ uuid = "7043C7FC-0028-426B-91A7-E05945E62122 - e2bfb6c05dd5ae7"
413
+ shouldBeEnabled = "Yes"
414
+ ignoreCount = "0"
415
+ continueAfterRunningActions = "No"
416
+ symbolName = "__C.UIView.systemLayoutFittingIntrinsicHeightFixedWidth(_: CoreGraphics.CGFloat, priority: __C.UILayoutPriority) -&gt; __C.CGSize"
417
+ moduleName = "Example (Multiplatform)"
418
+ usesParentBreakpointCondition = "Yes"
419
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift"
420
+ startingColumnNumber = "9223372036854775807"
421
+ endingColumnNumber = "9223372036854775807"
422
+ startingLineNumber = "394"
423
+ endingLineNumber = "394"
424
+ offsetFromSymbolStart = "97">
425
+ </Location>
459
426
  </Locations>
460
427
  </BreakpointContent>
461
428
  </BreakpointProxy>
@@ -566,22 +533,6 @@
566
533
  landmarkType = "7">
567
534
  </BreakpointContent>
568
535
  </BreakpointProxy>
569
- <BreakpointProxy
570
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
571
- <BreakpointContent
572
- uuid = "93EDC5AB-8948-4148-83CC-FDDCB8BE5AFE"
573
- shouldBeEnabled = "No"
574
- ignoreCount = "0"
575
- continueAfterRunningActions = "No"
576
- filePath = "Example/Example/AnimationPreviewView.swift"
577
- startingColumnNumber = "9223372036854775807"
578
- endingColumnNumber = "9223372036854775807"
579
- startingLineNumber = "119"
580
- endingLineNumber = "119"
581
- landmarkName = "AnimationPreviewView"
582
- landmarkType = "14">
583
- </BreakpointContent>
584
- </BreakpointProxy>
585
536
  <BreakpointProxy
586
537
  BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
587
538
  <BreakpointContent
@@ -627,71 +578,134 @@
627
578
  endingLineNumber = "40"
628
579
  offsetFromSymbolStart = "724">
629
580
  </Location>
630
- </Locations>
631
- </BreakpointContent>
632
- </BreakpointProxy>
633
- <BreakpointProxy
634
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
635
- <BreakpointContent
636
- uuid = "8628051F-F131-475B-8FBA-5C9F7B7F9CF8"
637
- shouldBeEnabled = "Yes"
638
- ignoreCount = "0"
639
- continueAfterRunningActions = "No"
640
- filePath = "Sources/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift"
641
- startingColumnNumber = "9223372036854775807"
642
- endingColumnNumber = "9223372036854775807"
643
- startingLineNumber = "49"
644
- endingLineNumber = "49"
645
- landmarkName = "reloadImages()"
646
- landmarkType = "7">
647
- <Locations>
648
581
  <Location
649
- uuid = "8628051F-F131-475B-8FBA-5C9F7B7F9CF8 - b71115c8bcbe1c53"
582
+ uuid = "6054DF71-1266-422E-9C2F-56F48E5C9F70 - e420b5ae81b770cf"
650
583
  shouldBeEnabled = "Yes"
651
584
  ignoreCount = "0"
652
585
  continueAfterRunningActions = "No"
653
- symbolName = "Lottie.LayerImageProvider.reloadImages() -&gt; ()"
586
+ symbolName = "Lottie.FilepathImageProvider.imageForAsset(asset: Lottie.ImageAsset) -&gt; Swift.Optional&lt;__C.CGImageRef&gt;"
654
587
  moduleName = "Lottie"
655
588
  usesParentBreakpointCondition = "Yes"
656
- urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift"
657
- startingColumnNumber = "9223372036854775807"
658
- endingColumnNumber = "9223372036854775807"
659
- startingLineNumber = "49"
660
- endingLineNumber = "49"
661
- offsetFromSymbolStart = "746">
662
- </Location>
663
- <Location
664
- uuid = "8628051F-F131-475B-8FBA-5C9F7B7F9CF8 - 36c5635116204a6"
665
- shouldBeEnabled = "Yes"
666
- ignoreCount = "0"
667
- continueAfterRunningActions = "No"
668
- symbolName = "Lottie.LayerImageProvider.reloadImages() -&gt; ()"
669
- moduleName = "lottieBugReproduction"
670
- usesParentBreakpointCondition = "Yes"
671
- urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift"
589
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Public/iOS/FilepathImageProvider.swift"
672
590
  startingColumnNumber = "9223372036854775807"
673
591
  endingColumnNumber = "9223372036854775807"
674
- startingLineNumber = "49"
675
- endingLineNumber = "49"
676
- offsetFromSymbolStart = "746">
592
+ startingLineNumber = "40"
593
+ endingLineNumber = "40"
594
+ offsetFromSymbolStart = "1171">
677
595
  </Location>
678
596
  <Location
679
- uuid = "8628051F-F131-475B-8FBA-5C9F7B7F9CF8 - 2d1ae2090cf799a0"
597
+ uuid = "6054DF71-1266-422E-9C2F-56F48E5C9F70 - 7e2b426f31fef53c"
680
598
  shouldBeEnabled = "Yes"
681
599
  ignoreCount = "0"
682
600
  continueAfterRunningActions = "No"
683
- symbolName = "Lottie.LayerImageProvider.reloadImages() -&gt; ()"
601
+ symbolName = "Lottie.FilepathImageProvider.imageForAsset(asset: Lottie.ImageAsset) -&gt; Swift.Optional&lt;__C.CGImageRef&gt;"
684
602
  moduleName = "Example (Multiplatform)"
685
603
  usesParentBreakpointCondition = "Yes"
686
- urlString = "file:///Users/calstephens/Documents/lottie/Sources/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift"
604
+ urlString = "file:///Users/calstephens/Documents/lottie/Sources/Public/iOS/FilepathImageProvider.swift"
687
605
  startingColumnNumber = "9223372036854775807"
688
606
  endingColumnNumber = "9223372036854775807"
689
- startingLineNumber = "49"
690
- endingLineNumber = "49"
691
- offsetFromSymbolStart = "746">
607
+ startingLineNumber = "40"
608
+ endingLineNumber = "40"
609
+ offsetFromSymbolStart = "724">
692
610
  </Location>
693
611
  </Locations>
694
612
  </BreakpointContent>
695
613
  </BreakpointProxy>
614
+ <BreakpointProxy
615
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
616
+ <BreakpointContent
617
+ uuid = "2DA5783A-2045-4949-B58C-D2CC2CAFB2DD"
618
+ shouldBeEnabled = "No"
619
+ ignoreCount = "0"
620
+ continueAfterRunningActions = "No"
621
+ filePath = "Sources/Private/CoreAnimation/CoreAnimationLayer.swift"
622
+ startingColumnNumber = "9223372036854775807"
623
+ endingColumnNumber = "9223372036854775807"
624
+ startingLineNumber = "136"
625
+ endingLineNumber = "136"
626
+ landmarkName = "playAnimation(configuration:playbackState:)"
627
+ landmarkType = "7">
628
+ </BreakpointContent>
629
+ </BreakpointProxy>
630
+ <BreakpointProxy
631
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
632
+ <BreakpointContent
633
+ uuid = "2072A61F-3E42-440F-AC47-65B54BC1B0B6"
634
+ shouldBeEnabled = "No"
635
+ ignoreCount = "0"
636
+ continueAfterRunningActions = "No"
637
+ filePath = "Sources/Private/CoreAnimation/CoreAnimationLayer.swift"
638
+ startingColumnNumber = "9223372036854775807"
639
+ endingColumnNumber = "9223372036854775807"
640
+ startingLineNumber = "165"
641
+ endingLineNumber = "165"
642
+ landmarkName = "display()"
643
+ landmarkType = "7">
644
+ </BreakpointContent>
645
+ </BreakpointProxy>
646
+ <BreakpointProxy
647
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
648
+ <BreakpointContent
649
+ uuid = "32B9C255-985F-49E5-98A9-E22C87338B37"
650
+ shouldBeEnabled = "No"
651
+ ignoreCount = "0"
652
+ continueAfterRunningActions = "No"
653
+ filePath = "Sources/Public/Animation/LottieView.swift"
654
+ startingColumnNumber = "9223372036854775807"
655
+ endingColumnNumber = "9223372036854775807"
656
+ startingLineNumber = "156"
657
+ endingLineNumber = "156"
658
+ landmarkName = "body"
659
+ landmarkType = "24">
660
+ </BreakpointContent>
661
+ </BreakpointProxy>
662
+ <BreakpointProxy
663
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
664
+ <BreakpointContent
665
+ uuid = "482CC806-EDF2-4272-92C3-DEBDE27B896D"
666
+ shouldBeEnabled = "No"
667
+ ignoreCount = "0"
668
+ continueAfterRunningActions = "No"
669
+ filePath = "Sources/Public/Animation/LottieView.swift"
670
+ startingColumnNumber = "9223372036854775807"
671
+ endingColumnNumber = "9223372036854775807"
672
+ startingLineNumber = "396"
673
+ endingLineNumber = "396"
674
+ landmarkName = "reloadAnimationTrigger(_:showPlaceholder:)"
675
+ landmarkType = "7">
676
+ </BreakpointContent>
677
+ </BreakpointProxy>
678
+ <BreakpointProxy
679
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
680
+ <BreakpointContent
681
+ uuid = "B0E97E57-281C-4787-BE2F-03F9AB8F2A0A"
682
+ shouldBeEnabled = "No"
683
+ ignoreCount = "0"
684
+ continueAfterRunningActions = "No"
685
+ filePath = "Example/Example/AnimationPreviewView.swift"
686
+ startingColumnNumber = "9223372036854775807"
687
+ endingColumnNumber = "9223372036854775807"
688
+ startingLineNumber = "205"
689
+ endingLineNumber = "205"
690
+ landmarkName = "option(_:keyPath:value:)"
691
+ landmarkType = "7">
692
+ </BreakpointContent>
693
+ </BreakpointProxy>
694
+ <BreakpointProxy
695
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
696
+ <BreakpointContent
697
+ uuid = "223C727A-14EC-4AD5-9CAE-C6B25769F657"
698
+ shouldBeEnabled = "No"
699
+ ignoreCount = "0"
700
+ continueAfterRunningActions = "No"
701
+ filePath = "Sources/Public/Animation/LottieView.swift"
702
+ startingColumnNumber = "9223372036854775807"
703
+ endingColumnNumber = "9223372036854775807"
704
+ startingLineNumber = "240"
705
+ endingLineNumber = "240"
706
+ landmarkName = "animationDidFinish(_:)"
707
+ landmarkType = "7">
708
+ </BreakpointContent>
709
+ </BreakpointProxy>
696
710
  </Breakpoints>
697
711
  </Bucket>
package/Package.swift CHANGED
@@ -17,5 +17,6 @@ let package = Package(
17
17
  "Private/EmbeddedLibraries/README.md",
18
18
  "Private/EmbeddedLibraries/ZipFoundation/README.md",
19
19
  "Private/EmbeddedLibraries/EpoxyCore/README.md",
20
+ "Private/EmbeddedLibraries/LRUCache/README.md",
20
21
  ]),
21
22
  ])
package/README.md CHANGED
@@ -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.3.3")
44
+ .package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.3.4")
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.
@@ -36,27 +36,8 @@ final class ShapeLayer: BaseCompositionLayer {
36
36
  private let shapeLayer: ShapeLayerModel
37
37
 
38
38
  private func setUpGroups(context: LayerContext) throws {
39
- // If the layer has a `Repeater`, the `Group`s are duplicated and offset
40
- // based on the copy count of the repeater.
41
- if let repeater = shapeLayer.items.first(where: { $0 is Repeater }) as? Repeater {
42
- try setUpRepeater(repeater, context: context)
43
- } else {
44
- let shapeItems = shapeLayer.items.map { ShapeItemLayer.Item(item: $0, groupPath: []) }
45
- try setupGroups(from: shapeItems, parentGroup: nil, parentGroupPath: [], context: context)
46
- }
47
- }
48
-
49
- private func setUpRepeater(_ repeater: Repeater, context: LayerContext) throws {
50
- let items = shapeLayer.items.filter { !($0 is Repeater) }
51
- let copyCount = Int(try repeater.copies.exactlyOneKeyframe(context: context, description: "repeater copies").value)
52
-
53
- for index in 0..<copyCount {
54
- let shapeItems = items.map { ShapeItemLayer.Item(item: $0, groupPath: []) }
55
- for groupLayer in try makeGroupLayers(from: shapeItems, parentGroup: nil, parentGroupPath: [], context: context) {
56
- let repeatedLayer = RepeaterLayer(repeater: repeater, childLayer: groupLayer, index: index)
57
- addSublayer(repeatedLayer)
58
- }
59
- }
39
+ let shapeItems = shapeLayer.items.map { ShapeItemLayer.Item(item: $0, groupPath: []) }
40
+ try setupGroups(from: shapeItems, parentGroup: nil, parentGroupPath: [], context: context)
60
41
  }
61
42
 
62
43
  }
@@ -181,6 +162,9 @@ final class GroupLayer: BaseAnimationLayer {
181
162
  }
182
163
 
183
164
  extension CALayer {
165
+
166
+ // MARK: Fileprivate
167
+
184
168
  /// Sets up `GroupLayer`s for each `Group` in the given list of `ShapeItem`s
185
169
  /// - Each `Group` item becomes its own `GroupLayer` sublayer.
186
170
  /// - Other `ShapeItem` are applied to all sublayers
@@ -191,21 +175,79 @@ extension CALayer {
191
175
  context: LayerContext)
192
176
  throws
193
177
  {
194
- let groupLayers = try makeGroupLayers(
195
- from: items,
196
- parentGroup: parentGroup,
197
- parentGroupPath: parentGroupPath,
198
- context: context)
199
-
200
- for groupLayer in groupLayers {
201
- addSublayer(groupLayer)
178
+ // If the layer has any `Repeater`s, set up each repeater
179
+ // and then handle any remaining groups like normal.
180
+ if items.contains(where: { $0.item is Repeater }) {
181
+ let repeaterGroupings = items.split(whereSeparator: { $0.item is Repeater })
182
+
183
+ // Iterate through the groupings backwards to preserve the expected rendering order
184
+ for repeaterGrouping in repeaterGroupings.reversed() {
185
+ // Each repeater applies to the previous items in the list
186
+ if let repeater = repeaterGrouping.trailingSeparator?.item as? Repeater {
187
+ try setUpRepeater(
188
+ repeater,
189
+ items: repeaterGrouping.grouping,
190
+ parentGroup: parentGroup,
191
+ parentGroupPath: parentGroupPath,
192
+ context: context)
193
+ }
194
+
195
+ // Any remaining items after the last repeater are handled like normal
196
+ else {
197
+ try setupGroups(
198
+ from: repeaterGrouping.grouping,
199
+ parentGroup: parentGroup,
200
+ parentGroupPath: parentGroupPath,
201
+ context: context)
202
+ }
203
+ }
204
+ }
205
+
206
+ else {
207
+ let groupLayers = try makeGroupLayers(
208
+ from: items,
209
+ parentGroup: parentGroup,
210
+ parentGroupPath: parentGroupPath,
211
+ context: context)
212
+
213
+ for groupLayer in groupLayers {
214
+ addSublayer(groupLayer)
215
+ }
216
+ }
217
+ }
218
+
219
+ // MARK: Private
220
+
221
+ /// Sets up this layer using the given `Repeater`
222
+ private func setUpRepeater(
223
+ _ repeater: Repeater,
224
+ items allItems: [ShapeItemLayer.Item],
225
+ parentGroup: Group?,
226
+ parentGroupPath: [String],
227
+ context: LayerContext)
228
+ throws
229
+ {
230
+ let items = allItems.filter { !($0.item is Repeater) }
231
+ let copyCount = Int(try repeater.copies.exactlyOneKeyframe(context: context, description: "repeater copies").value)
232
+
233
+ for index in 0..<copyCount {
234
+ let groupLayers = try makeGroupLayers(
235
+ from: items,
236
+ parentGroup: parentGroup,
237
+ parentGroupPath: parentGroupPath,
238
+ context: context)
239
+
240
+ for groupLayer in groupLayers {
241
+ let repeatedLayer = RepeaterLayer(repeater: repeater, childLayer: groupLayer, index: index)
242
+ addSublayer(repeatedLayer)
243
+ }
202
244
  }
203
245
  }
204
246
 
205
247
  /// Creates a `GroupLayer` for each `Group` in the given list of `ShapeItem`s
206
248
  /// - Each `Group` item becomes its own `GroupLayer` sublayer.
207
249
  /// - Other `ShapeItem` are applied to all sublayers
208
- fileprivate func makeGroupLayers(
250
+ private func makeGroupLayers(
209
251
  from items: [ShapeItemLayer.Item],
210
252
  parentGroup: Group?,
211
253
  parentGroupPath: [String],
@@ -346,6 +388,32 @@ extension Collection {
346
388
 
347
389
  return (trueElements, falseElements)
348
390
  }
391
+
392
+ /// Splits this collection into an array of grouping separated by the given separator.
393
+ /// For example, `[A, B, C]` split by `B` returns an array with two elements:
394
+ /// 1. `(grouping: [A], trailingSeparator: B)`
395
+ /// 2. `(grouping: [C], trailingSeparator: nil)`
396
+ func split(whereSeparator separatorPredicate: (Element) -> Bool)
397
+ -> [(grouping: [Element], trailingSeparator: Element?)]
398
+ {
399
+ guard !isEmpty else { return [] }
400
+
401
+ var groupings: [(grouping: [Element], trailingSeparator: Element?)] = []
402
+
403
+ for element in self {
404
+ if groupings.isEmpty || groupings.last?.trailingSeparator != nil {
405
+ groupings.append((grouping: [], trailingSeparator: nil))
406
+ }
407
+
408
+ if separatorPredicate(element) {
409
+ groupings[groupings.indices.last!].trailingSeparator = element
410
+ } else {
411
+ groupings[groupings.indices.last!].grouping.append(element)
412
+ }
413
+ }
414
+
415
+ return groupings
416
+ }
349
417
  }
350
418
 
351
419
  // MARK: - ShapeRenderGroup
@@ -1,9 +1,9 @@
1
1
  // Created by eric_horacek on 10/8/21.
2
2
  // Copyright © 2021 Airbnb Inc. All rights reserved.
3
3
 
4
+ #if canImport(SwiftUI) && !os(macOS)
4
5
  import SwiftUI
5
6
 
6
- #if !os(macOS)
7
7
  // MARK: - EpoxySwiftUIUIHostingController
8
8
 
9
9
  /// A `UIHostingController` that hosts SwiftUI views within an Epoxy container, e.g. an Epoxy
@@ -1,11 +1,10 @@
1
1
  // Created by eric_horacek on 9/16/21.
2
2
  // Copyright © 2021 Airbnb Inc. All rights reserved.
3
3
 
4
+ #if canImport(Combine) && canImport(SwiftUI) && !os(macOS)
4
5
  import Combine
5
6
  import SwiftUI
6
7
 
7
- #if !os(macOS)
8
-
9
8
  // MARK: - SwiftUIHostingViewReuseBehavior
10
9
 
11
10
  /// The reuse behavior of an `EpoxySwiftUIHostingView`.
@@ -387,5 +386,4 @@ struct EpoxyHostingWrapper<Content: View>: View {
387
386
  .environment(\.epoxyIntrinsicContentSizeInvalidator, environment.intrinsicContentSizeInvalidator)
388
387
  }
389
388
  }
390
-
391
389
  #endif
@@ -1,6 +1,7 @@
1
1
  // Created by matthew_cheok on 11/19/21.
2
2
  // Copyright © 2021 Airbnb Inc. All rights reserved.
3
3
 
4
+ #if canImport(SwiftUI)
4
5
  import SwiftUI
5
6
 
6
7
  // MARK: - EpoxyIntrinsicContentSizeInvalidator
@@ -42,3 +43,4 @@ extension EnvironmentValues {
42
43
  private struct EpoxyIntrinsicContentSizeInvalidatorKey: EnvironmentKey {
43
44
  static let defaultValue = EpoxyIntrinsicContentSizeInvalidator(invalidate: { })
44
45
  }
46
+ #endif
@@ -1,6 +1,7 @@
1
1
  // Created by eric_horacek on 10/8/21.
2
2
  // Copyright © 2021 Airbnb Inc. All rights reserved.
3
3
 
4
+ #if canImport(SwiftUI)
4
5
  import SwiftUI
5
6
 
6
7
  // MARK: - View
@@ -49,3 +50,4 @@ private struct EpoxyLayoutMarginsPadding: ViewModifier {
49
50
  content.padding(epoxyLayoutMargins)
50
51
  }
51
52
  }
53
+ #endif
@@ -1,6 +1,7 @@
1
1
  // Created by eric_horacek on 9/13/21.
2
2
  // Copyright © 2021 Airbnb Inc. All rights reserved.
3
3
 
4
+ #if canImport(SwiftUI)
4
5
  import SwiftUI
5
6
 
6
7
  // MARK: - StyledView
@@ -170,3 +171,4 @@ extension StyledView
170
171
  }
171
172
  }
172
173
  }
174
+ #endif
@@ -1,6 +1,7 @@
1
1
  // Created by eric_horacek on 6/22/22.
2
2
  // Copyright © 2022 Airbnb Inc. All rights reserved.
3
3
 
4
+ #if canImport(SwiftUI)
4
5
  import SwiftUI
5
6
 
6
7
  // MARK: - MeasuringViewRepresentable
@@ -126,3 +127,4 @@ extension MeasuringViewRepresentable {
126
127
  #endif
127
128
  }
128
129
  #endif
130
+ #endif