-
Notifications
You must be signed in to change notification settings - Fork 1
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
세팅 뷰 추가 #58
Conversation
MojitoBar
commented
Dec 27, 2023
- 로그아웃을 세팅 뷰로 분리했습니다.
- 세팅 뷰의 항목을 클릭하면 한 번 더 확인하는 팝업이 뜨는 기능을 추가했습니다.
- 이미지에 디스크캐싱을 적용했습니다.
- 세팅뷰에서 디스크캐싱의 현황을 확인하고 삭제하는 기능을 추가헀습니다.
|
||
private func performInitialDataPopulation() { | ||
var snapshot = NSDiffableDataSourceSnapshot<Int, String>() | ||
snapshot.appendSections([0]) |
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.
섹션은 상수값이 아닌 enum으로 관리해서 이름도 명확하게 해보면 어떨까요?
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 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 |
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.
cell을 생성하는 영역도 어떻게 공통코드로 빼서 단순화 시켜볼수 있지 않을까요?
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 configureDiffableDataSource() { | ||
dataSource = UITableViewDiffableDataSource<Int, String>(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, _ in |
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.
UITableViewDiffableDataSource<Int, String> 이러한 부분은 typealias를 이용해서 단순하게 만들어 볼 수 있을것 같습니다.
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.
pins/Utils/DiskCacheManager.swift
Outdated
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() { |
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.
jpeg는 1.0보다는 보통 0.7을 많이 사용하는 편이긴합니다.
https://stackoverflow.com/questions/26330492/what-should-compressionquality-be-when-using-uiimagejpegrepresentation
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.
코드리뷰 남겨주신 내용 각각 커밋으로 반영해봤습니다 ! |
|