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

[DESIGN] #44 - 메인 화면 Card Flip 기능 구현 #45

Merged
merged 3 commits into from
Oct 16, 2021
Merged

[DESIGN] #44 - 메인 화면 Card Flip 기능 구현 #45

merged 3 commits into from
Oct 16, 2021

Conversation

mini-min
Copy link
Member

🌴 PR 요약

🌱 작업한 브랜치

🌱 작업한 내용

  • VerticalCardSwiperDelegate 안에 didTapCard로 클릭 시 로직을 추가했습니다.

  • UIView.transition, transitionFlipFrom..을 사용해서 카드 뒤집는거 구현했습니다.
    💡 왼쪽, 오른쪽 뒤집는 방향이랑, 속도, reload가 약간 지연되는 문제는 나중에 issue 파서 다시 이야기해봐야할 것 같아요!

  • 화면 연결
    1️⃣ 메인 뷰 - 명함 리스트 뷰 (push-pop)
    2️⃣ 메인 뷰 - 명함 생성 뷰 (present-dismiss)

  • BackCardCell 레이아웃 안맞아서 조금 수정했습니다 ^__^

  • Swiftlint: identifier_name 추가한거 지우고 변수명 3글자 이상으로 수정

📸 스크린샷

기능 스크린샷
영상 https://user-images.githubusercontent.com/69389288/137501964-10b9ffd6-1b1d-4caa-acc5-b0d3c9f59e61.mp4

📮 관련 이슈

@mini-min mini-min added Minjae 🐻‍❄️ 민재 강남1타강사 작업 P1 / Priority High 우선순위 높음 Feat 새로운 기능 구현 labels Oct 15, 2021
@mini-min mini-min self-assigned this Oct 15, 2021
Copy link
Member

@hyun99999 hyun99999 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 5 to 6
- function_parameter_count
- identifier_name
excluded:
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines 63 to 71
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 {
Copy link
Member

Choose a reason for hiding this comment

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

Const 구조체를 사용해주세요!

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 160 to 162
UIView.transition(with: frontCell ?? CardCell(), duration: 0.5, options: .transitionFlipFromLeft, animations: nil, completion: {_ in
self.cardSwiper.reloadData()
})
Copy link
Member

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()
             }
// ...

Copy link
Member Author

@mini-min mini-min Oct 15, 2021

Choose a reason for hiding this comment

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

아 맞네요:) 제가 클로저를 다루는게 아직 익숙하지가 않아서..감사합니다! 더 공부하겠습니다 ^_^

저도 그렇게 생각을 하고 animations에 처음 구현을 해줬는데 그렇게 구현하면 아예 저 transition 애니메이션이 먹지가 않더라구요.. (그냥 카드를 탭하면 애니메이션 없이 카드 셀만 바뀌게되는 상황이 되버려서..) completion에 넣어줘봤습니다!

Copy link
Member

Choose a reason for hiding this comment

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

데이터 자체를 로드하는 문제라서 animations 에서는 변화가 없는거 같은데 같이 한번 고민해봐야할거같아여 다음에 한번 이슈파서 얘기해봐야할거같아여
일단 필요하면 머지하시구 두셔두 되구 민재선배 고생했어!

@mini-min mini-min merged commit 2ef69ff into TeamNADA:develop Oct 16, 2021
@mini-min mini-min deleted the feature/#44 branch October 16, 2021 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 새로운 기능 구현 Minjae 🐻‍❄️ 민재 강남1타강사 작업 P1 / Priority High 우선순위 높음
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 메인화면 Card Flip 기능 구현
2 participants