From 441c79804d7476416e32e6aa9f6cc5e2f79722fc Mon Sep 17 00:00:00 2001 From: baegteun Date: Mon, 26 Aug 2024 23:30:03 +0900 Subject: [PATCH] =?UTF-8?q?:dizzy:=20::=20[#1238]=20=EC=9D=8C=EC=95=85=20?= =?UTF-8?q?=EC=9E=AC=EC=83=9D=20=ED=83=80=EC=9E=85=20Animation=20Spec=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlayTypeTogglePopupViewController.swift | 28 ++++++++----------- .../Setting/SettingViewController.swift | 1 + 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Projects/Features/MyInfoFeature/Sources/ViewControllers/PlayTypeTogglePopup/PlayTypeTogglePopupViewController.swift b/Projects/Features/MyInfoFeature/Sources/ViewControllers/PlayTypeTogglePopup/PlayTypeTogglePopupViewController.swift index 14360ccbb..570a8b27f 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewControllers/PlayTypeTogglePopup/PlayTypeTogglePopupViewController.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewControllers/PlayTypeTogglePopup/PlayTypeTogglePopupViewController.swift @@ -113,10 +113,18 @@ public final class PlayTypeTogglePopupViewController: UIViewController { override public func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - contentView.transform = CGAffineTransform(translationX: 0, y: self.view.frame.height) - UIView.animate(withDuration: 0.3, delay: 0, options: .curveEaseInOut, animations: { + contentView.transform = CGAffineTransform(translationX: 0, y: 80) + contentView.alpha = 0 + dimmView.alpha = 0 + let animator = UIViewPropertyAnimator(duration: 0.3, curve: .easeInOut) + animator.addAnimations { self.contentView.transform = CGAffineTransform.identity - }, completion: nil) + } + animator.addAnimations { + self.contentView.alpha = 1 + self.dimmView.alpha = 1 + } + animator.startAnimation() } func setActions() { @@ -251,19 +259,7 @@ private extension PlayTypeTogglePopupViewController { } func dismiss() { - UIView.animate( - withDuration: 0.3, - delay: 0, - options: .curveEaseInOut, - animations: { [weak self] in - guard let self = self else { return } - let translationY = self.view.frame.height - self.contentView.transform = CGAffineTransform(translationX: 0, y: translationY) - }, - completion: { [weak self] _ in - self?.dismiss(animated: false) - } - ) + self.dismiss(animated: false) } } diff --git a/Projects/Features/MyInfoFeature/Sources/ViewControllers/Setting/SettingViewController.swift b/Projects/Features/MyInfoFeature/Sources/ViewControllers/Setting/SettingViewController.swift index 5a60741db..8b1583d9a 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewControllers/Setting/SettingViewController.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewControllers/Setting/SettingViewController.swift @@ -285,6 +285,7 @@ extension SettingViewController: UITableViewDelegate { cancelCompletion: {} ) togglePopupVC.modalPresentationStyle = .overFullScreen + togglePopupVC.modalTransitionStyle = .crossDissolve self.present(togglePopupVC, animated: false) }