Skip to content

Commit

Permalink
[Merge pull request] main <- feature/#30-Swipe-To-Right-Refactor
Browse files Browse the repository at this point in the history
Feature/#30 swipe to right refactor
  • Loading branch information
sanghyeok-kim authored Feb 13, 2023
2 parents 2d73ec6 + a33711c commit 16c0e28
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ final class SwipeRightToStopNoticeView: UIView {
return lottieView
}()

private lazy var tapAnimationView: LottieAnimationView = {
let lottieView = LottieAnimationView(name: Constant.LottieAnimationName.tap)
lottieView.loopMode = .playOnce
lottieView.isHidden = true
return lottieView
}()

private lazy var cellImageView: UIImageView = {
let imageView = UIImageView(image: UIImage(named: Constant.AssetImageName.swipeCellRightToStop))
imageView.contentMode = .scaleAspectFit
Expand Down Expand Up @@ -62,13 +55,10 @@ final class SwipeRightToStopNoticeView: UIView {
extension SwipeRightToStopNoticeView {
func playAnimation() {
swipeAnimationView.play { [weak self] _ in
self?.tapAnimationView.isHidden = false
self?.tapAnimationView.play { _ in
UIView.animate(withDuration: 0.75) {
self?.alpha = .zero
} completion: { _ in
self?.isHidden = true
}
UIView.animate(withDuration: 0.75) {
self?.alpha = .zero
} completion: { _ in
self?.isHidden = true
}
}
}
Expand All @@ -90,7 +80,6 @@ private extension SwipeRightToStopNoticeView {
addSubview(backgroundView)
addSubview(cellImageView)
addSubview(swipeAnimationView)
addSubview(tapAnimationView)
addSubview(noticeLabel)

backgroundView.translatesAutoresizingMaskIntoConstraints = false
Expand All @@ -111,12 +100,6 @@ private extension SwipeRightToStopNoticeView {
swipeAnimationView.centerXAnchor.constraint(equalTo: centerXAnchor, constant: 20).isActive = true
swipeAnimationView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: 40).isActive = true

tapAnimationView.translatesAutoresizingMaskIntoConstraints = false
tapAnimationView.widthAnchor.constraint(equalTo: widthAnchor, multiplier: 0.3).isActive = true
tapAnimationView.heightAnchor.constraint(equalTo: heightAnchor, multiplier: 0.3).isActive = true
tapAnimationView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 10).isActive = true
tapAnimationView.centerYAnchor.constraint(equalTo: centerYAnchor, constant: 20).isActive = true

noticeLabel.translatesAutoresizingMaskIntoConstraints = false
noticeLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
noticeLabel.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class TimerTableViewDelegate: NSObject, UITableViewDelegate {
resetAction.backgroundColor = .systemBackground

let config = UISwipeActionsConfiguration(actions: [resetAction])
config.performsFirstActionWithFullSwipe = false
config.performsFirstActionWithFullSwipe = true
return config
}

Expand Down
1 change: 0 additions & 1 deletion Multimer/Multimer/Presentation/Support/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ enum Constant {

enum LottieAnimationName {
static let swipeRightToStopTimer = "swipe-right-to-stop-timer"
static let tap = "tap"
}

enum UserDefaultsKey {
Expand Down

0 comments on commit 16c0e28

Please sign in to comment.