-
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: 명함 만들기 뷰의 ViewModel 구현 (#376) #377
Conversation
- 명함 선택하는 배경을 setUI 에서 다룸 - 다크모드 대응을 위한 배경색 변경
- 배경색이 다시금 돌아오도록 하기 위함. - 이를 위해서 화면전환도 overfullscreen 이 아닌 fullscreen 으로 설정.
- RxGesture 를 사용하려다가 사용하면 ControlEvent trait 가 Observable 로 변하기 때문에 굳이 변환하지 않아도 된다고 판단.
@dlwns33 RxGesture 를 사용해서 리펙토링을 하고자 했는데요. basicBackgroundView.rx.tapGesture()
.when(.recognized)
.bind { _ in
// 뷰의 배경색 변경과 화면전환.
} 이를 사용해서 bind 안에 이벤트 동작을 넣거나 bind 하지 않고 tapGestue() 의 결과인 Observable 을 사용하는건데 UI 에 특화된 ControlEvent trait 에서 굳이 변환할 필요가 없다고 판단했습니당 어떻게 생각하시나요? |
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 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) | ||
} |
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.
화면 전환하는 코드를 factory 파일에 구현하도록 할게요!
사용법도 적어두겠습니당
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.
이런이런 일용할 양식을... 항상 배웁니다..🙇🏻♂️
@@ -128,21 +127,101 @@ class CardCreationCategoryViewController: UIViewController { | |||
return label | |||
}() | |||
|
|||
var viewModel = CardCreationCategoryViewModel() |
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.
요기서 뷰모델을 넣어주는 부분은 앞으로 factory 파일에서 해주게 될 거에요!
factory 파일을 추가하여 자세한 설명을 적어두도록 하겠습니당
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.
그러면 뷰 모델을 주입하는 개념이되겠군여!
의존성을 주입하는 방법에 대해서 고민했었는데 이번에 팩토리적용하면서 공부해보겠습니다
오호 그렇다면 RxGesture을 사용해서 리팩토링 하지 않고 지금 있는 상태로 둬도 될 것 같아요! 저는 RxGesture을 사용하면 gesture 인스턴스를 따로 만들지 않아도 되서 코드가 조금 더 간결해져서 사용했습니다! |
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
🚨 참고사항
📸 스크린샷
📮 관련 이슈