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

SettingsUseCase 및 ChangeUserNameUseCase 작성 #129

Merged
merged 5 commits into from
Dec 1, 2022

Conversation

LEEYOONJONG
Copy link
Member

@LEEYOONJONG LEEYOONJONG commented Nov 30, 2022

11/30 #125 #126 #127 #128

작업한 내용

SettingsUseCase와 ChangeUserNameUseCase를 작성했습니다.

  • 긴급회의에서 논의된 내용에 따라 닉네임 변경하는 메서드는 ChangeUserNameUseCase에 작성했습니다.

SettingsUseCase에서 LocalUtilityRepository 메서드를 이용합니다.

  • SettingsUseCase에선 LocalUtilityRepository의 UserDefaults 관련 함수를 활용하여 UISwitch 버튼 전환, 액션 시트 클릭에 따른 value를 저장합니다.
  • dataSource의 초기값을 getAutoPlayMode(), getDarkMode() 메서드를 이용해 지정하여 뷰에 처음 진입했을 때 저장되어 있는 값이 불러와지도록 합니다.

Simulator Screen Recording - iPhone 14 Pro - 2022-11-30 at 21 13 31

Copy link
Collaborator

@radiantchoi radiantchoi left a comment

Choose a reason for hiding this comment

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

싹 분리돼서 깔끔해져서, 꽤나 놀랐습니다.


final class SettingsRepositoryImpl: SettingsRepository {

}
Copy link
Collaborator

Choose a reason for hiding this comment

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

구조 바꾼 대로 잘 반영해 주셨군요, 좋습니다.

func getAutoPlayMode() -> Bool
func changeAutoPlayMode(to mode: Bool)
func getDarkMode() -> Int
func changeDarkMode(to mode: Int)
Copy link
Collaborator

Choose a reason for hiding this comment

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

처음엔 change to dark mode여야 하지 않나 했습니다만, 생각해 보니 두 가지가 아닌 세 가지의 상태가 있었죠. 문제없어보입니다.

return "항상 어둡게"
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

분리되어 있으니 깔끔하네요!

.settingsSwitch(title: "음악 자동 재생", isOn: true), // TODO: isOn은 로컬 디비로부터 불러와야 합니다.
.settingsActionSheet(title: "다크 모드")
.settingsSwitch(title: "음악 자동 재생", isOn: settingsUseCase.getAutoPlayMode()),
.settingsActionSheet(title: "다크 모드", mode: settingsUseCase.getDarkMode())
Copy link
Collaborator

Choose a reason for hiding this comment

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

데이터 소스의 해법을 이렇게 찾으셨군요..! 어쩌면 이것이 PublishSubject보다 좋을지도 모르겠습니다.

Copy link
Member

@BaeRoNuI BaeRoNuI left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

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.

debugPrint()를 통하여 전체적으로 프린트 찍어보면서 잘 동작하는지 확인하는 모습 좋습니다 :)
경민님께서 달아주신대로 잘 분리되어 있어서 더더욱 읽기 편하였습니다!

수고하셨습니다!

@radiantchoi radiantchoi merged commit eeadb76 into develop Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants