-
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
[DESIGN] #44 - 메인 화면 Card Flip 기능 구현 #45
Conversation
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.
👍
- function_parameter_count | ||
- identifier_name | ||
excluded: |
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.
👍
guard let nextVC = UIStoryboard(name: "CardList", bundle: nil).instantiateViewController(identifier: "CardListViewController") as? CardListViewController else { return } | ||
self.navigationController?.pushViewController(nextVC, animated: true) | ||
} | ||
|
||
// 명함 생성 뷰로 화면 전환 | ||
@IBAction func presentToCardCreationView(_ sender: Any) { | ||
let stortboard = UIStoryboard(name: "CardCreation", bundle: nil) | ||
|
||
if let nextVC = stortboard.instantiateViewController(identifier: "CardCreationViewController") as? CardCreationViewController { |
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.
Const 구조체를 사용해주세요!
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.
앗 넵넵!
UIView.transition(with: frontCell ?? CardCell(), duration: 0.5, options: .transitionFlipFromLeft, animations: nil, completion: {_ in | ||
self.cardSwiper.reloadData() | ||
}) |
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.
completion 은 애니메이션이 끝난 후에 동작하는 거라서 animations 에 reloadData() 를 넣으면 우려했던 딜레이가 해결될거같은데요!
그리고 클로저가 들어가는 마지막 매개변수는 다음과도 같이 표현이 가능해요!
UIView.transition(with: frontCell ?? CardCell(), duration: 0.5, options: .transitionFlipFromLeft, animations: nil) { _ in
self.cardSwiper.reloadData()
}
// ...
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.
아 맞네요:) 제가 클로저를 다루는게 아직 익숙하지가 않아서..감사합니다! 더 공부하겠습니다 ^_^
저도 그렇게 생각을 하고 animations에 처음 구현을 해줬는데 그렇게 구현하면 아예 저 transition 애니메이션이 먹지가 않더라구요.. (그냥 카드를 탭하면 애니메이션 없이 카드 셀만 바뀌게되는 상황이 되버려서..) completion에 넣어줘봤습니다!
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.
데이터 자체를 로드하는 문제라서 animations 에서는 변화가 없는거 같은데 같이 한번 고민해봐야할거같아여 다음에 한번 이슈파서 얘기해봐야할거같아여
일단 필요하면 머지하시구 두셔두 되구 민재선배 고생했어!
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
VerticalCardSwiperDelegate 안에 didTapCard로 클릭 시 로직을 추가했습니다.
UIView.transition, transitionFlipFrom..을 사용해서 카드 뒤집는거 구현했습니다.
💡 왼쪽, 오른쪽 뒤집는 방향이랑, 속도, reload가 약간 지연되는 문제는 나중에 issue 파서 다시 이야기해봐야할 것 같아요!
화면 연결
1️⃣ 메인 뷰 - 명함 리스트 뷰 (push-pop)
2️⃣ 메인 뷰 - 명함 생성 뷰 (present-dismiss)
BackCardCell 레이아웃 안맞아서 조금 수정했습니다 ^__^
Swiftlint: identifier_name 추가한거 지우고 변수명 3글자 이상으로 수정
📸 스크린샷
📮 관련 이슈