Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
calda committed Jan 11, 2024
1 parent e31cfd0 commit 4d0af81
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
20 changes: 10 additions & 10 deletions Lottie.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@
0887347C28F0CCDD00458627 /* LottieAnimationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0887347428F0CCDD00458627 /* LottieAnimationView.swift */; };
0887347D28F0CCDD00458627 /* LottieAnimationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0887347428F0CCDD00458627 /* LottieAnimationView.swift */; };
089C50C22ABA0C6D007903D3 /* LoggingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089C50C12ABA0C6D007903D3 /* LoggingTests.swift */; };
089E5D9F2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift */; };
089E5DA02B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift */; };
089E5DA12B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift */; };
089E5DA22B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift */; };
089E5D9F2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift */; };
089E5DA02B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift */; };
089E5DA12B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift */; };
089E5DA22B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift */; };
08AB05552A61C20400DE86FD /* ReducedMotionOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AB05542A61C20400DE86FD /* ReducedMotionOption.swift */; };
08AB05562A61C20400DE86FD /* ReducedMotionOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AB05542A61C20400DE86FD /* ReducedMotionOption.swift */; };
08AB05572A61C20400DE86FD /* ReducedMotionOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AB05542A61C20400DE86FD /* ReducedMotionOption.swift */; };
Expand Down Expand Up @@ -1190,7 +1190,7 @@
0887347328F0CCDD00458627 /* LottieAnimationViewInitializers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LottieAnimationViewInitializers.swift; sourceTree = "<group>"; };
0887347428F0CCDD00458627 /* LottieAnimationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LottieAnimationView.swift; sourceTree = "<group>"; };
089C50C12ABA0C6D007903D3 /* LoggingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggingTests.swift; sourceTree = "<group>"; };
089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Keyframes+timeRemap.swift"; sourceTree = "<group>"; };
089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Keyframes+timeRemapping.swift"; sourceTree = "<group>"; };
08AB05542A61C20400DE86FD /* ReducedMotionOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReducedMotionOption.swift; sourceTree = "<group>"; };
08AB05582A61C5B700DE86FD /* DecodingStrategy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecodingStrategy.swift; sourceTree = "<group>"; };
08AB055C2A61C5CC00DE86FD /* RenderingEngineOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenderingEngineOption.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2150,7 +2150,7 @@
2E9C95AA2822F43100677516 /* CALayer+fillBounds.swift */,
2E9C95AB2822F43100677516 /* Keyframes+combined.swift */,
2E9C95AC2822F43100677516 /* KeyframeGroup+exactlyOneKeyframe.swift */,
089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift */,
089E5D9E2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -2948,7 +2948,7 @@
080DEFB12A9570FE00BE2D96 /* WillDisplayProviding.swift in Sources */,
080DEFE82A95711E00BE2D96 /* ImageLayer.swift in Sources */,
080DF0672A95717600BE2D96 /* AnimatorNodeDebugging.swift in Sources */,
089E5DA22B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */,
089E5DA22B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */,
080DEFAC2A9570FE00BE2D96 /* StyleIDProviding.swift in Sources */,
080DF0002A95712400BE2D96 /* CombinedShapeAnimation.swift in Sources */,
080DEFD42A95711400BE2D96 /* Archive+Helpers.swift in Sources */,
Expand Down Expand Up @@ -3011,7 +3011,7 @@
0887346F28F0CBDE00458627 /* LottieAnimation.swift in Sources */,
08C002002A46150D00AB54BA /* Data+CompressionDeprecated.swift in Sources */,
0820D5B82A8BF159007D705C /* DropShadowStyle.swift in Sources */,
089E5D9F2B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */,
089E5D9F2B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */,
2E9C97412822F43100677516 /* TestHelpers.swift in Sources */,
08EF21DC289C643B0097EA47 /* KeyframeInterpolator.swift in Sources */,
2E9C96152822F43100677516 /* Transform.swift in Sources */,
Expand Down Expand Up @@ -3326,7 +3326,7 @@
2E9C966D2822F43100677516 /* LayerImageProvider.swift in Sources */,
2EAF5ABD27A0798700E00531 /* FilepathImageProvider.swift in Sources */,
2EAF5AEA27A0798700E00531 /* AnimationTextProvider.swift in Sources */,
089E5DA02B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */,
089E5DA02B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */,
08E206FE2A56014E002DCE17 /* Diffable.swift in Sources */,
2E9C96672822F43100677516 /* LayerTransformNode.swift in Sources */,
0887347028F0CBDE00458627 /* LottieAnimation.swift in Sources */,
Expand Down Expand Up @@ -3615,7 +3615,7 @@
0887347128F0CBDE00458627 /* LottieAnimation.swift in Sources */,
2E9C97432822F43100677516 /* TestHelpers.swift in Sources */,
0820D5BA2A8BF159007D705C /* DropShadowStyle.swift in Sources */,
089E5DA12B4CCD3F00F4F836 /* Keyframes+timeRemap.swift in Sources */,
089E5DA12B4CCD3F00F4F836 /* Keyframes+timeRemapping.swift in Sources */,
08EF21DE289C643B0097EA47 /* KeyframeInterpolator.swift in Sources */,
2E9C96172822F43100677516 /* Transform.swift in Sources */,
2E9C97492822F43100677516 /* CGFloatExtensions.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension CALayer {
context: context)
}

/// Otherwise continue using the previous codepath that doesn't support complex time remapping.
/// Otherwise continue using the legacy codepath that doesn't support complex time remapping.
/// - TODO: We could remove this codepath in favor of always using the simpler codepath above,
/// but would have to solve https://github.com/airbnb/lottie-ios/pull/2254 for that codepath.
else {
Expand Down Expand Up @@ -61,20 +61,3 @@ extension CALayer {
}
}
}

// MARK: - Hold

/// An `Interpolatable` container that animates using "hold" keyframes.
/// The keyframes do not animate, and instead always display the value from the most recent keyframe.
/// This is necessary when passing non-interpolatable values to a method that requires an `Interpolatable` conformance.
struct Hold<T>: Interpolatable {
let value: T

func interpolate(to: Hold<T>, amount: CGFloat) -> Hold<T> {
if amount < 1 {
return self
} else {
return to
}
}
}
17 changes: 17 additions & 0 deletions Sources/Public/Keyframes/Interpolatable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,20 @@ extension Optional: Interpolatable, AnyInterpolatable where Wrapped: Interpolata
return self.interpolate(to: to, amount: amount)
}
}

// MARK: - Hold

/// An `Interpolatable` container that animates using "hold" keyframes.
/// The keyframes do not animate, and instead always display the value from the most recent keyframe.
/// This is necessary when passing non-interpolatable values to a method that requires an `Interpolatable` conformance.
struct Hold<T>: Interpolatable {
let value: T

func interpolate(to: Hold<T>, amount: CGFloat) -> Hold<T> {
if amount < 1 {
return self
} else {
return to
}
}
}

0 comments on commit 4d0af81

Please sign in to comment.