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

[FEAT] #105 - 명함생성 미리보기 뷰 명함 화면전환효과 추가 #106

Merged
merged 4 commits into from
Dec 4, 2021

Conversation

hyun99999
Copy link
Member

🌴 PR 요약

🌱 작업한 브랜치

🌱 작업한 내용

  • 명함생성 미리보기 뷰 명함 화면전환효과 추가

📸 스크린샷

기능 스크린샷
화면전환

📮 관련 이슈

@hyun99999 hyun99999 added the Feat 새로운 기능 구현 label Dec 2, 2021
@hyun99999 hyun99999 self-assigned this Dec 2, 2021
Copy link
Member

@dlwns33 dlwns33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

천재교수님 스무스 하네요 근데 이거 저번 풀리퀘랑 섞여들어간걸까요..? 체인지 된 파일이 중복된거같아요!

Comment on lines +89 to +95
let swipeLeftGestureRecognizer = UISwipeGestureRecognizer(target: self, action: #selector(transitionCardWithAnimation(_:)))
swipeLeftGestureRecognizer.direction = .left
self.cardView.addGestureRecognizer(swipeLeftGestureRecognizer)

let swipeRightGestureRecognizer = UISwipeGestureRecognizer(target: self, action: #selector(transitionCardWithAnimation(_:)))
swipeRightGestureRecognizer.direction = .right
self.cardView.addGestureRecognizer(swipeRightGestureRecognizer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

레프트 앤 롸잇~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

에압~ ㅋㅋㅋㅋ
저번 풀리퀘가 안닫힌채로 제가 푸시해서 파일이 중복될겁니당...

Comment on lines +101 to 129
private func transitionCardWithAnimation(_ swipeGesture: UISwipeGestureRecognizer) {
if isFront {
guard let backCard = BackCardCell.nib().instantiate(withOwner: self, options: nil).first as? BackCardCell else { return }
guard let backCardDataModel = backCardDataModel else { return }
backCard.frame = CGRect(x: 0, y: 0, width: cardView.frame.width, height: cardView.frame.height)
backCard.initCell(cardBackgroundImage, backCardDataModel.isMincho, !backCardDataModel.isMincho, backCardDataModel.isSoju, !backCardDataModel.isSoju, backCardDataModel.isBoomuk, !backCardDataModel.isBoomuk, backCardDataModel.isSauced, !backCardDataModel.isSauced, backCardDataModel.firstTMI, backCardDataModel.secondTMI, backCardDataModel.thirdTMI)

cardView.addSubview(backCard)
isFront = false
} else {
guard let frontCard = FrontCardCell.nib().instantiate(withOwner: self, options: nil).first as? FrontCardCell else { return }

frontCard.frame = CGRect(x: 0, y: 0, width: cardView.frame.width, height: cardView.frame.height)
guard let frontCardDataModel = frontCardDataModel else { return }
frontCard.initCell(cardBackgroundImage, frontCardDataModel.title, frontCardDataModel.description, frontCardDataModel.name, frontCardDataModel.birthDate, frontCardDataModel.mbti, frontCardDataModel.instagramID, frontCardDataModel.linkURL)

cardView.addSubview(frontCard)
isFront = true
}
if swipeGesture.direction == .right {
UIView.transition(with: cardView, duration: 1, options: .transitionFlipFromLeft, animations: nil) { _ in
self.cardView.subviews[0].removeFromSuperview()
}
} else {
UIView.transition(with: cardView, duration: 1, options: .transitionFlipFromRight, animations: nil) { _ in
self.cardView.subviews[0].removeFromSuperview()
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스무스 하네요.. 이런 gesture는 처음 배워갑니다!

@cyleeeee
Copy link

cyleeeee commented Dec 3, 2021

못하는 게 뭘까..? 천재가 틀림없다👊

@hyun99999 hyun99999 merged commit 7ec3d18 into TeamNADA:develop Dec 4, 2021
@hyun99999 hyun99999 deleted the feature/#105 branch December 4, 2021 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 새로운 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 명함생성 미리보기 뷰 명함 화면전환효과 추가
3 participants