From 3ce898bb48c31e8c40d42239132285ba5021da6b Mon Sep 17 00:00:00 2001 From: Choyoungjun Date: Fri, 27 Sep 2024 11:00:31 +0900 Subject: [PATCH] =?UTF-8?q?CHORE=20::=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/Lottie/PiCKLottieView.swift | 25 ++++++++----------- .../OnBoarding/OnboardingViewModel.swift | 8 +++--- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Projects/Modules/DesignSystem/Sources/Component/Lottie/PiCKLottieView.swift b/Projects/Modules/DesignSystem/Sources/Component/Lottie/PiCKLottieView.swift index 2bae0d4..1337559 100644 --- a/Projects/Modules/DesignSystem/Sources/Component/Lottie/PiCKLottieView.swift +++ b/Projects/Modules/DesignSystem/Sources/Component/Lottie/PiCKLottieView.swift @@ -9,25 +9,22 @@ import Core public class PiCKLottieView: UIView { private var lottieAnimationView: LottieAnimationView? - private var animation: LottieAnimation? private let rawValue = UserDefaultStorage.shared.get(forKey: .displayMode) as? Int - public init() { - super.init(frame: .zero) - -// let animation: LottieAnimation? = AnimationAsset.pickLottie.animation - var animation: LottieAnimation? { - switch rawValue { - case 2: - AnimationAsset.darkLottie.animation + private var animation: LottieAnimation? { + switch rawValue { + case 2: + return AnimationAsset.darkLottie.animation - default: - AnimationAsset.whiteLottie.animation - } + default: + return AnimationAsset.whiteLottie.animation } + } - self.lottieAnimationView = .init(animation: animation) + public init() { + super.init(frame: .zero) + self.lottieAnimationView = .init(animation: animation) self.configureView() } required init?(coder: NSCoder) { @@ -44,8 +41,8 @@ public class PiCKLottieView: UIView { } public func play() { - self.lottieAnimationView?.play() self.lottieAnimationView?.animationSpeed = 3.5 + self.lottieAnimationView?.play() } } diff --git a/Projects/Presentation/Sources/Scene/OnBoarding/OnboardingViewModel.swift b/Projects/Presentation/Sources/Scene/OnBoarding/OnboardingViewModel.swift index 6c591a5..05efdfb 100644 --- a/Projects/Presentation/Sources/Scene/OnBoarding/OnboardingViewModel.swift +++ b/Projects/Presentation/Sources/Scene/OnBoarding/OnboardingViewModel.swift @@ -37,7 +37,7 @@ public class OnboardingViewModel: BaseViewModel, Stepper { } private let animate = PublishRelay() - private let showComponet = PublishRelay() + private let showComponent = PublishRelay() public func transform(input: Input) -> Output { input.viewWillAppear @@ -68,8 +68,8 @@ public class OnboardingViewModel: BaseViewModel, Stepper { input.componentAppear.asObservable() .throttle(.seconds(2), scheduler: MainScheduler.asyncInstance) - .map { _ in self.showComponet.accept(()) } - .bind(to: showComponet) + .map { _ in self.showComponent.accept(()) } + .bind(to: showComponent) .disposed(by: disposeBag) input.clickOnboardingButton @@ -79,7 +79,7 @@ public class OnboardingViewModel: BaseViewModel, Stepper { return Output( animate: animate.asSignal(), - showComponet: showComponet.asSignal() + showComponet: showComponent.asSignal() ) }