Skip to content

[iDLE-183] 요양보호사 프로필 조회및 수정 #23

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

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

J0onYEong
Copy link
Contributor

변경사항

동영상

default.mp4

확인화면

확인화면은 ViewModel을 구현하였으며, 바인딩 부분에서 센터장 프로필과 다른 방식을 선택했습니다.
센터장 프로필의 경우 변화가 발생하는 부분만 업데이트할 필요가 있어 1대1로 UI와 데이터를 바인딩하였지만, 요양보호시 프로필은 확인화면과 수정화면이 불리되어 있어 아래와 같이 VO하나를 통째로 전달받아 뷰에 할당하는 식으로 구현하였습니다.

스크린샷 2024-07-23 오전 10 00 38

궁금한점

아직 API 명세가 나오지는 않았지만
수정화면의 경우 다수 입력을 한 화면에서 받고 그것을 ViewModel로 전달해야 합니다. 어떤 방식을 사용하는 것이 적합한 것인지 궁금합니다.

생각했던 방식들입니다. 😅

  • ViewModel에 프로퍼티로 class 인스턴스를 저장하고 View가 그것을 참조하여 객체를 매번 업데이트
  • ViewController에서 모든 인풋들을 하나로 묶어 '저장'버튼 클릭시 ViewModel로 한번에 전달

@J0onYEong J0onYEong requested a review from monibu1548 July 23, 2024 01:18
@J0onYEong J0onYEong merged commit 714db72 into develop Jul 23, 2024
1 check passed
return .just(.success(.mock))
}

private func fetchImageFrom(url: URL) -> Single<UIImage?> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

보통 ViewModel -> View 로는 image URL을 전달합니다. 굳이 ViewModel에서 URL로 이미지를 다운받아서 View로 전달하진 않아요.

대부분 KingFisher등 이미지 라이브러리를 사용할거고, source로 URL을 사용할 수 있습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아하.. 고민됬었던 부분이였습니다! KingFisher라이브러를 사용하는 방법으로 고려해보겠습니다 감사합니다!

@J0onYEong J0onYEong deleted the feature/worker_profile branch July 30, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants