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

일기 작성 흐름 중 음악 검색 부분 작성 #165

Merged
merged 13 commits into from
Dec 7, 2022

Conversation

radiantchoi
Copy link
Collaborator

12/6 #141 #156 #158

작업한 내용

음악 검색 흐름을 변경했습니다. ShazamSession을 Repository에서 가지고 있도록 변경했습니다.

  • PublishSubject를 통해 결과를 받아 오고, 검색중인지 여부는 뷰 모델에서 가지고 있게 됩니다.

덤 : 로그인 로직 시도해봤습니다. 잘 됩니다..?!

  • 로그인 뷰 컨트롤러도 정리했습니다.

일기 작성 뷰 컨트롤러, 샤잠세션도 정리했습니다.

고민한 점 및 어려웠던 점

PublishSubject 프로퍼티의 연쇄로 값을 전달해야 하나 고민했습니다.

  • 아시다시피, ShazamKit은 delegate 메서드를 사용해 결과를 반환합니다.
  • 그래서 그 결과값을 어떻게 스트림으로 받아올까 많은 삽질과 고민을 했지만, 결국 클린 아키텍처의 모든 단계에 PublishSubject 변수를 만들어 값이 변할 때마다 화면까지 대응시킬 수 밖에 없었습니다.
  • 검색 시작 함수를 누르면, 깔쌈하게 흐름이 갔다가 올라오는 것은 없을까.. 고민했습니다. Rx는 이런 비동기 흐름을 다루기 위한 프레임워크인데..

switch $0 {
case .success(let shazamSongDTO):
let musicInfo = MusicInfo(shazamSong: shazamSongDTO)
self.musicInfoResult.onNext(.success(musicInfo))
Copy link
Member

Choose a reason for hiding this comment

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

이런 식으로 전달하는 게 최선이지 싶습니다,, 더 좋은 방법을 저도 못떠올리겟네요ㅠ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이번주의 주제로 삼아 볼까 싶기도 합니다.. ㅋㅋㅋㅋ

Copy link
Member

@LEEYOONJONG LEEYOONJONG left a comment

Choose a reason for hiding this comment

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

고생하셨습니다. 이런 식으로 Subject 등을 이용해서 각 계층에 전달해주는 방법 밖에는 생각이 저도 안나네요..ㅠ

Copy link
Collaborator

@rudah7 rudah7 left a comment

Choose a reason for hiding this comment

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

고민하신 부분은.. 제 생각도 delegate 메서드라 어쩔 수 없을거 같긴 합니다.. ㅠㅠ

수고하셨습니다!

@@ -102,7 +102,7 @@ final class LoginViewController: UIViewController {
let view = UIView()

view.backgroundColor = .clear

view.isUserInteractionEnabled = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

정녕 이거때문이였다니... 충격...

@radiantchoi radiantchoi merged commit 760c97e into develop Dec 7, 2022
@radiantchoi radiantchoi deleted the feature/diary-edit-flow branch December 7, 2022 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants