Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”€ :: (#1238) μŒμ•… μž¬μƒ νƒ€μž… νŒμ—… Animation Spec λ³€κ²½ #1240

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ extension SettingViewController: UITableViewDelegate {
cancelCompletion: {}
)
togglePopupVC.modalPresentationStyle = .overFullScreen
togglePopupVC.modalTransitionStyle = .crossDissolve
self.present(togglePopupVC, animated: false)
}

Expand Down
Loading