-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
### Descriptions - FrontCardCell 불투명 뷰 추가 - CardInGroupCell 불투명 뷰 추가 - 이미지피커뷰 추가 및 적용 - 배경 선택도 필수로 추가
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
천재교수님 스무스 하네요 근데 이거 저번 풀리퀘랑 섞여들어간걸까요..? 체인지 된 파일이 중복된거같아요!
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레프트 앤 롸잇~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에압~ ㅋㅋㅋㅋ
저번 풀리퀘가 안닫힌채로 제가 푸시해서 파일이 중복될겁니당...
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() | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스무스 하네요.. 이런 gesture는 처음 배워갑니다!
못하는 게 뭘까..? 천재가 틀림없다👊 |
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
📸 스크린샷
📮 관련 이슈