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

다크모드 기능 구현 #161

Merged
merged 6 commits into from
Dec 7, 2022
Merged

다크모드 기능 구현 #161

merged 6 commits into from
Dec 7, 2022

Conversation

LEEYOONJONG
Copy link
Member

12/6 #157 #159 #160

작업한 내용

다크모드 색상을 추가했습니다.

  • 다크모드 설정시 보여줄 색상이 지정되어 있지 않아 추가했습니다.

다크모드 화면을 UserDefaults에 지정된 값에 따라 업데이트해주었습니다.

  • 앱이 처음 실행될 때 SceneDelegate에서도 저장된 값에 따라 다크모드가 바로 설정될 수 있도록 DarkModeManager를 싱글톤으로 별도로 생성하였습니다.

고민한 점 및 어려웠던 점

DarkModeManager를 유즈케이스에서 이용하는 것이 맞나 하는 고민을 했습니다.

  • DarkModeManager는 LocalUtilityRepository로부터 UserDefaults값을 가져와 뷰를 직접적으로 업데이트해주는 역할을 수행합니다.
  • SceneDelegate에서 다크모드 설정을 해주기 위한 고육책이었지만, DarkModeManager를 SettingUseCase에서 이용하는게 맞나 하는 고민을 했습니다. 유즈케이스가 유즈케이스를 이용하는 격이기 때문입니다.
  • 다만 이렇게 하지 않을 경우 코드의 일관성이 저하됩니다. 이로 인해 일단 유즈케이스에서 DarkModeManager을 이용하도록 작성해놓았습니다. 이부분에 대한 의견 부탁드립니다!

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.

확실히 별도의 매니저로 빼니까 깔끔하군요!

저는 별도의 매니저로 뺐기 때문에 그냥 이대로 사용하여도 괜찮을 것 같다고 생각하긴 합니다..!

수고하셨습니다~

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.

의외로 신경쓸 부분이 있는 작업이었다고 생각이 듭니다. 꼼꼼히 잘 체크해 주셨습니다.


private init() {
self.repository = LocalUtilityRepositoryImpl()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분을 Implment를 직접 가져오기보다는 우리가 해 왔던 동적인 스타일로 바꾸면 좋을 것 같다~ 라고 생각했는데, 어차피 private init이라 밖에서 불러올 일이 없는 이니셜라이저겠군요.

@radiantchoi radiantchoi merged commit 85672d2 into develop Dec 7, 2022
@radiantchoi radiantchoi deleted the feature/dark-mode branch December 7, 2022 05:10
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