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
@@ -146,7 +146,7 @@ extension DotLottieFile {
146
146
  bundle: Bundle = Bundle.main,
147
147
  subdirectory: String? = nil,
148
148
  dotLottieCache: DotLottieCacheProvider? = DotLottieCache.sharedCache,
149
- dispatchQueue: DispatchQueue = .global(),
149
+ dispatchQueue: DispatchQueue = .dotLottie,
150
150
  handleResult: @escaping (Result<DotLottieFile, Error>) -> Void)
151
151
  {
152
152
  dispatchQueue.async {
@@ -186,7 +186,7 @@ extension DotLottieFile {
186
186
  public static func loadedFrom(
187
187
  filepath: String,
188
188
  dotLottieCache: DotLottieCacheProvider? = DotLottieCache.sharedCache,
189
- dispatchQueue: DispatchQueue = .global(),
189
+ dispatchQueue: DispatchQueue = .dotLottie,
190
190
  handleResult: @escaping (Result<DotLottieFile, Error>) -> Void)
191
191
  {
192
192
  dispatchQueue.async {
@@ -228,7 +228,7 @@ extension DotLottieFile {
228
228
  named name: String,
229
229
  bundle: Bundle = Bundle.main,
230
230
  dotLottieCache: DotLottieCacheProvider? = DotLottieCache.sharedCache,
231
- dispatchQueue: DispatchQueue = .global(),
231
+ dispatchQueue: DispatchQueue = .dotLottie,
232
232
  handleResult: @escaping (Result<DotLottieFile, Error>) -> Void)
233
233
  {
234
234
  dispatchQueue.async {
@@ -331,7 +331,7 @@ extension DotLottieFile {
331
331
  public static func loadedFrom(
332
332
  data: Data,
333
333
  filename: String,
334
- dispatchQueue: DispatchQueue = .global(),
334
+ dispatchQueue: DispatchQueue = .dotLottie,
335
335
  handleResult: @escaping (Result<DotLottieFile, Error>) -> Void)
336
336
  {
337
337
  dispatchQueue.async {
@@ -358,7 +358,7 @@ extension DotLottieFile {
358
358
  public static func loadedFrom(
359
359
  data: Data,
360
360
  filename: String,
361
- dispatchQueue: DispatchQueue = .global())
361
+ dispatchQueue: DispatchQueue = .dotLottie)
362
362
  async throws -> DotLottieFile
363
363
  {
364
364
  try await withCheckedThrowingContinuation { continuation in
@@ -367,5 +367,12 @@ extension DotLottieFile {
367
367
  }
368
368
  }
369
369
  }
370
+ }
370
371
 
372
+ extension DispatchQueue {
373
+ /// A serial dispatch queue ensures that IO related to loading dot Lottie files don't overlap,
374
+ /// which can trigger file loading errors due to concurrent unzipping on a single archive.
375
+ public static let dotLottie = DispatchQueue(
376
+ label: "com.airbnb.lottie.dot-lottie",
377
+ qos: .userInitiated)
371
378
  }
@@ -39,7 +39,11 @@ open class LottieAnimationViewBase: UIView {
39
39
 
40
40
  var screenScale: CGFloat {
41
41
  #if os(iOS) || os(tvOS)
42
- UIScreen.main.scale
42
+ if #available(iOS 13.0, tvOS 13.0, *) {
43
+ return max(UITraitCollection.current.displayScale, 1)
44
+ } else {
45
+ return UIScreen.main.scale
46
+ }
43
47
  #else // if os(visionOS)
44
48
  // We intentionally don't check `#if os(visionOS)`, because that emits
45
49
  // a warning when building on Xcode 14 and earlier.
@@ -79,6 +83,5 @@ open class LottieAnimationViewBase: UIView {
79
83
  func animationWillEnterForeground() {
80
84
  // Implemented by subclasses.
81
85
  }
82
-
83
86
  }
84
87
  #endif
@@ -8,7 +8,7 @@
8
8
 
9
9
  Pod::Spec.new do |s|
10
10
  s.name = 'lottie-ios'
11
- s.version = '4.3.3'
11
+ s.version = '4.3.4'
12
12
  s.summary = 'A library to render native animations from bodymovin json'
13
13
 
14
14
  s.description = <<-DESC
@@ -36,5 +36,6 @@ Lottie enables designers to create and ship beautiful animations without an engi
36
36
  s.ios.frameworks = ['UIKit', 'CoreGraphics', 'QuartzCore']
37
37
  s.tvos.frameworks = ['UIKit', 'CoreGraphics', 'QuartzCore']
38
38
  s.osx.frameworks = ['AppKit', 'CoreGraphics', 'QuartzCore']
39
+ s.weak_frameworks = ['SwiftUI', 'Combine']
39
40
  s.module_name = 'Lottie'
40
41
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lottie-ios",
3
- "version": "4.3.3",
3
+ "version": "4.3.4",
4
4
  "description": "Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with bodymovin and renders the vector animations natively on mobile and through React Native!",
5
5
  "main": "index.js",
6
6
  "scripts": {