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

DiffableDataSource + Compositional Layout으로 마이그레이션 #58

Merged
merged 14 commits into from
Jan 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import DSKit
final class ProfileCollectionViewCell: UICollectionViewCell {
private lazy var imageView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = .scaleAspectFit
imageView.contentMode = .scaleToFill
Copy link
Member

Choose a reason for hiding this comment

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

피그마 기준 샘플 이미지에서 여자가 앉아있는 이미지 기준으로 contentMode가 aspectFit이어야 하지 않나요?
또 scaleToFill이 맞다고 해도 scaleToAspectFill이 더 적절할 것 같아요!

imageView.layer.masksToBounds = true
Copy link
Member

Choose a reason for hiding this comment

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

그냥 scale보다는 AspectScale이 비율 유지할 수 있을 것 같아서 변경
aspectFit에서 fill로 변경한 이유 알려주시면 감사하겠습니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

scaleToFill 사용한 이유는 사실 이미지가 꽉 채워졌을 때를 확인하려고 썼던 거긴 해요. 고정으로 할 생각은 없었습니다.
scaleAspectFill을 하게 되면 비율 그대로 확대하다보니, 이미지가 짤립니다.
추후에는 이미지를 비율대로 자르고 확대하는게 어떨까 싶네요
생각해보니까 자르고 확대하나 비율에 맞게 스케일을 키우는 게 똑같은거 같긴하네요

return imageView
}()
Expand Down Expand Up @@ -46,13 +46,7 @@ final class ProfileCollectionViewCell: UICollectionViewCell {
guard let url = URL(string: imageURL) else {
return
}
let random: [DSKitImages] = [DSKitAsset.Image.Test.test1, DSKitAsset.Image.Test.test2]

self.imageView.image = random.randomElement()?.image

// self.imageView.setResource(url) { [weak self] in
// self?.imageView.sizeToFit()
// self?.imageView.layoutIfNeeded()
// }
self.imageView.kf.setImage(with: url)
}
Copy link
Member

Choose a reason for hiding this comment

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

sampleData image는 url보니까 token이 있던데 토큰 만료될 일이 없나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

이거 픽사베이에서 무료로 이미지 넣어 놓은 거긴한데 만료되는지는 잘 모르겠네요

}