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: 명함 만들기 뷰의 ViewModel 구현 (#376) #377

Merged
merged 11 commits into from
Mar 15, 2023

Conversation

hyun99999
Copy link
Member

@hyun99999 hyun99999 commented Mar 9, 2023

🌴 PR 요약

🌱 작업한 브랜치

🌱 작업한 내용

  • 명함 만들기 뷰의 뷰모델을 구현했습니다.
  • 딱히 뷰모델에서 다룰 데이터는 없었지만 이벤트를 input 하고 ouput 해서 스트림을 끊기지 않게 해서 bind 하는 과정을 연습해보았습니당
  • 다음에는 좀 더 잘 적용해볼 수 있겠죠..!?
  • 탭 제스처를 사용해서 뷰에 액션을 부여했습니다.

🚨 참고사항

  • ViewModelType 을 만들었습니당 사용하기에 괜찮을까요?
  • 스크린샷 초반에 보시면 홈에서 배경이 다크모드 적용이 안된듯합니당
  • 기본 명함은 현재 만들어진 명함 생성 뷰로 이어집니다. 덕질과 직장은 현재 구현이 비어있는 메서드로 대체했습니다.

📸 스크린샷

기능 스크린샷
명함 만들기 뷰

📮 관련 이슈

@hyun99999 hyun99999 added Hyungyu 🐯 현규 교수님 작업 Feat 새로운 기능 구현 labels Mar 9, 2023
@hyun99999 hyun99999 requested a review from dlwns33 March 9, 2023 08:59
@hyun99999 hyun99999 self-assigned this Mar 9, 2023
- RxGesture 를 사용하려다가 사용하면 ControlEvent trait 가 Observable 로 변하기 때문에 굳이 변환하지 않아도 된다고 판단.
@hyun99999
Copy link
Member Author

@dlwns33
어떻게 생각하시나여?

RxGesture 를 사용해서 리펙토링을 하고자 했는데요.

        basicBackgroundView.rx.tapGesture()
            .when(.recognized)
            .bind { _ in
               // 뷰의 배경색 변경과 화면전환.
            }

이를 사용해서 bind 안에 이벤트 동작을 넣거나 bind 하지 않고 tapGestue() 의 결과인 Observable 을 사용하는건데 UI 에 특화된 ControlEvent trait 에서 굳이 변환할 필요가 없다고 판단했습니당 어떻게 생각하시나요?

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.

image
나다의 시간은 다시 흘러간다 수고하셨습니다🫡

Comment on lines +205 to +210
private func presentToBasicCardCreationViewController() {
guard let nextVC = UIStoryboard(name: Const.Storyboard.Name.cardCreation, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.cardCreationViewController) as? CardCreationViewController else { return }
let navigationController = UINavigationController(rootViewController: nextVC)
navigationController.modalPresentationStyle = .fullScreen
self.navigationController?.present(navigationController, animated: true)
}
Copy link
Member

Choose a reason for hiding this comment

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

화면 전환하는 코드를 factory 파일에 구현하도록 할게요!
사용법도 적어두겠습니당

Copy link
Member Author

Choose a reason for hiding this comment

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

이런이런 일용할 양식을... 항상 배웁니다..🙇🏻‍♂️

@@ -128,21 +127,101 @@ class CardCreationCategoryViewController: UIViewController {
return label
}()

var viewModel = CardCreationCategoryViewModel()
Copy link
Member

Choose a reason for hiding this comment

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

요기서 뷰모델을 넣어주는 부분은 앞으로 factory 파일에서 해주게 될 거에요!
factory 파일을 추가하여 자세한 설명을 적어두도록 하겠습니당

Copy link
Member Author

Choose a reason for hiding this comment

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

그러면 뷰 모델을 주입하는 개념이되겠군여!
의존성을 주입하는 방법에 대해서 고민했었는데 이번에 팩토리적용하면서 공부해보겠습니다

@dlwns33
Copy link
Member

dlwns33 commented Mar 13, 2023

@dlwns33 어떻게 생각하시나여?

RxGesture 를 사용해서 리펙토링을 하고자 했는데요.

        basicBackgroundView.rx.tapGesture()
            .when(.recognized)
            .bind { _ in
               // 뷰의 배경색 변경과 화면전환.
            }

이를 사용해서 bind 안에 이벤트 동작을 넣거나 bind 하지 않고 tapGestue() 의 결과인 Observable 을 사용하는건데 UI 에 특화된 ControlEvent trait 에서 굳이 변환할 필요가 없다고 판단했습니당 어떻게 생각하시나요?

오호 그렇다면 RxGesture을 사용해서 리팩토링 하지 않고 지금 있는 상태로 둬도 될 것 같아요!

저는 RxGesture을 사용하면 gesture 인스턴스를 따로 만들지 않아도 되서 코드가 조금 더 간결해져서 사용했습니다!
그리고 (나다에서는 아니겠지만) 혹시 다른 종류의 gesture을 사용하게 된다면 바로 바꿔주기에도 좋을 것 같아서!
image

@hyun99999 hyun99999 merged commit 07cf6fd into TeamNADA:develop Mar 15, 2023
@hyun99999 hyun99999 deleted the feature/#376 branch March 15, 2023 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 새로운 기능 구현 Hyungyu 🐯 현규 교수님 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 명함 만들기 뷰의 ViewModel 구현
2 participants