From 09912d0b85bbaa08100d1800306ac6e333572123 Mon Sep 17 00:00:00 2001 From: Jessica Pham Date: Wed, 23 Oct 2019 15:34:18 -0700 Subject: [PATCH 1/2] expose animation speed for animated control --- lottie-swift/src/Public/iOS/AnimatedControl.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lottie-swift/src/Public/iOS/AnimatedControl.swift b/lottie-swift/src/Public/iOS/AnimatedControl.swift index 27a68e31b8..6348808743 100644 --- a/lottie-swift/src/Public/iOS/AnimatedControl.swift +++ b/lottie-swift/src/Public/iOS/AnimatedControl.swift @@ -40,6 +40,13 @@ open class AnimatedControl: UIControl { animationDidSet() } } + + /// Sets the speed of the animation playback. Defaults to 1 + public var animationSpeed: CGFloat = 1 { + didSet { + animationView.animationSpeed = animationSpeed + } + } /// Sets which Animation Layer should be visible for the given state. public func setLayer(named: String, forState: UIControl.State) { From 88a9d4337b9af32ca494b38e7773d7c95482d354 Mon Sep 17 00:00:00 2001 From: Jessica Pham Date: Thu, 24 Oct 2019 17:44:54 -0700 Subject: [PATCH 2/2] address PR comments --- lottie-swift/src/Public/iOS/AnimatedControl.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lottie-swift/src/Public/iOS/AnimatedControl.swift b/lottie-swift/src/Public/iOS/AnimatedControl.swift index 6348808743..cf9a700996 100644 --- a/lottie-swift/src/Public/iOS/AnimatedControl.swift +++ b/lottie-swift/src/Public/iOS/AnimatedControl.swift @@ -41,11 +41,10 @@ open class AnimatedControl: UIControl { } } - /// Sets the speed of the animation playback. Defaults to 1 - public var animationSpeed: CGFloat = 1 { - didSet { - animationView.animationSpeed = animationSpeed - } + /// The speed of the animation playback. Defaults to 1 + public var animationSpeed: CGFloat { + set { animationView.animationSpeed = newValue } + get { return animationView.animationSpeed } } /// Sets which Animation Layer should be visible for the given state.