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

세팅 뷰 추가 #58

Merged
merged 17 commits into from
Jan 3, 2024
Merged

세팅 뷰 추가 #58

merged 17 commits into from
Jan 3, 2024

Conversation

MojitoBar
Copy link
Collaborator

  • 로그아웃을 세팅 뷰로 분리했습니다.
  • 세팅 뷰의 항목을 클릭하면 한 번 더 확인하는 팝업이 뜨는 기능을 추가했습니다.
  • 이미지에 디스크캐싱을 적용했습니다.
  • 세팅뷰에서 디스크캐싱의 현황을 확인하고 삭제하는 기능을 추가헀습니다.

@MojitoBar MojitoBar self-assigned this Dec 27, 2023

private func performInitialDataPopulation() {
var snapshot = NSDiffableDataSourceSnapshot<Int, String>()
snapshot.appendSections([0])

Choose a reason for hiding this comment

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

섹션은 상수값이 아닌 enum으로 관리해서 이름도 명확하게 해보면 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

private func configureDiffableDataSource() {
dataSource = UITableViewDiffableDataSource<Int, String>(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, _ in
guard let self else { fatalError("self is nil") }
let cell = tableView.dequeueReusableCell(withIdentifier: "SettingViewCell", for: indexPath) as? SettingViewCell

Choose a reason for hiding this comment

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

cell을 생성하는 영역도 어떻게 공통코드로 빼서 단순화 시켜볼수 있지 않을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

}

private func configureDiffableDataSource() {
dataSource = UITableViewDiffableDataSource<Int, String>(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, _ in

Choose a reason for hiding this comment

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

UITableViewDiffableDataSource<Int, String> 이러한 부분은 typealias를 이용해서 단순하게 만들어 볼 수 있을것 같습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

enum DiskCacheManager {
static func cacheImage(_ image: UIImage, withFilename filename: String) {
let hash = CryptoUtils.sha256(filename)
if let data = image.jpegData(compressionQuality: 1.0) ?? image.pngData() {

Choose a reason for hiding this comment

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

jpeg는 1.0보다는 보통 0.7을 많이 사용하는 편이긴합니다.
https://stackoverflow.com/questions/26330492/what-should-compressionquality-be-when-using-uiimagejpegrepresentation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@MojitoBar
Copy link
Collaborator Author

코드리뷰 남겨주신 내용 각각 커밋으로 반영해봤습니다 !

Copy link

sonarqubecloud bot commented Jan 3, 2024

@MojitoBar MojitoBar merged commit 16fa73f into main Jan 3, 2024
3 checks passed
@MojitoBar MojitoBar deleted the feature/setting-view branch January 3, 2024 12:44
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