-
Notifications
You must be signed in to change notification settings - Fork 6
[Feat] #139 - 러닝 기록 수정 페이지 UI 및 api 연결 #140
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] #139 - 러닝 기록 수정 페이지 UI 및 api 연결 #140
The head ref may contain hidden characters: "feat/#139-\uB7EC\uB2DD-\uAE30\uB85D-\uC218\uC815-\uD398\uC774\uC9C0-UI-\uBC0F-api-\uC5F0\uACB0"
Conversation
lsj8706
left a comment
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.
수고하셨습니다~~!👍
코멘트 남긴 부분 한번 잘 고민해보고 가능하면 적용도 해보면 좋을 거 같아요!
| case titleWithLeftButton // 뒤로가기 버튼 + 중앙 타이틀 | ||
| case search // 검색창 | ||
| case report // 신고 | ||
| case editModeForTitleWithLeftButton // 수정하기 페이지일 때 |
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.
NaviBar에 타입을 추가하는 방식으로 하셨군요..!
제가 의도했던 방식에서 네비바의 타입은 네비바 자체의 UI에서 새로운 것이 생길때 추가하는 것이지 버튼 터치했을 때 동작이 생겼을 때 추가하는 방식이 아니었어요!
물론 이렇게 해도 동작은 의도한대로 하겠지만 객체의 책임과 역할의 측면에서 다음과 같이 아쉬운 부분이 생길 것 같습니다!
- CustomNaviBar는 중복되는 View 파일을 VC에서 분리한 것으로 단순히 "뷰"만 그리는 것이 좋습니다! 즉, 최대한 단순해야 한다는 것입니다.
- 특히, NaviBar의 좌측(뒤로가기)버튼을 눌렀을 때 알러트 팝업이 보여지도록 하는 것은 네비바 입장에서는 필요없는 책임입니다. 이 액션은 NaviBar를 생성한 VC에서 처리할 작업이지 View파일인 네비바가 이 역할을 담당하는 것은 SRP에서 벗어난다고 생각합니다
- 그리고, 기존의 함수들에 type을 파러미터로 더 추가하여 분기처리를 하고 있는데 하나의 함수에서는 최소한의 파라미터와 최소한의 분기처리를 담당하도록 해야합니다. (클린 코드적 측면)
결론
사실 이미 기존에 잘 만들어진 함수가 있습니다!
resetLeftButtonAction 함수를 이용해 네비바를 호출한 VC에서 뒤로가기 버튼을 클릭했을 때 처리할 액션을 지정할 수 있습니다.
즉, 수정하기VC에서 CustomNaviBar를 반든 부분이 있을텐데 그 뒤에 이어서 resetLeftButtonAction를 호출하고 파라미터로 들어갈 클로져에 팝업뷰를 보여주는 코드를 넣으면 될 것 같습니다..!
이런 방식으로 시도하다가 잘 안되면 언제든 연락주세요~!
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 setEditMode() { |
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.
긴 작업이 있었네요! 수고하셨습니다~~!
|
일단 qa 해야하니까 머지 할게요! 브랜치 하나 파서 고치겠습니다.. |
🌱 작업한 내용
🌱 PR Point
📸 스크린샷
📮 관련 이슈