Skip to content

Commit

Permalink
Merge pull request #281 from OMZigak/fix/#280-blurred-image
Browse files Browse the repository at this point in the history
[fix] 프로필 이미지가 흐려지는 현상 수정 및 이미지 설정 코드 간결화
  • Loading branch information
JinUng41 authored Aug 8, 2024
2 parents dbd2ea0 + 3c801d8 commit 6f44185
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
2 changes: 2 additions & 0 deletions KkuMulKum/Source/AddPromise/Cell/PlaceListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ extension PlaceListCell {
private extension PlaceListCell {
func configureCell(title: String, roadAddress: String?, address: String?) {
titleLabel.setText(title, style: .body05, color: .gray8)

roadAddressNameLabel.setText(
roadAddress ?? " ",
style: .caption02,
color: .gray6,
isSingleLine: true
)

addressNameLabel.setText(
address ?? " ",
style: .caption02,
Expand Down
6 changes: 3 additions & 3 deletions KkuMulKum/Source/AddPromise/Cell/SelectMemberCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ extension SelectMemberCell {
self.member = member

nameLabel.setText(member.name ?? " ", style: .body06, color: .gray6)
profileImageView.image = .imgProfile.withRenderingMode(.alwaysOriginal)
guard let imageURL = URL(string: member.profileImageURL ?? "") else { return }
profileImageView.kf.setImage(with: imageURL)

let imageURL = member.profileImageURL.flatMap { URL(string: $0) }
profileImageView.kf.setImage(with: imageURL, placeholder: UIImage.imgProfile.withRenderingMode(.alwaysOriginal))
}
}
21 changes: 7 additions & 14 deletions KkuMulKum/Source/MeetingInfo/Cell/MeetingMemberCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ protocol MeetingMemberCellDelegate: AnyObject {

final class MeetingMemberCell: BaseCollectionViewCell {
private let profileImageButton = UIButton().then {
$0.backgroundColor = .gray2
$0.layer.cornerRadius = Screen.height(64) / 2
$0.isEnabled = false
$0.clipsToBounds = true
Expand All @@ -35,7 +34,7 @@ final class MeetingMemberCell: BaseCollectionViewCell {

profileImageButton.do {
$0.imageView?.image = nil
$0.backgroundColor = .gray2
$0.backgroundColor = .clear
$0.isEnabled = false
}

Expand Down Expand Up @@ -100,21 +99,15 @@ private extension MeetingMemberCell {

func configureForProfile(with member: Member) {
let name = member.name
let imageURL = member.profileImageURL
let imageURL = member.profileImageURL.flatMap { URL(string: $0) }

nameLabel.setText(name ?? " ", style: .caption02, color: .gray6)
profileImageButton.setImage(
.imgProfile.withRenderingMode(.alwaysOriginal),
for: .normal
)

setProfileImage(urlString: imageURL ?? "")
}

func setProfileImage(urlString: String) {
guard let url = URL(string: urlString) else { return }

profileImageButton.kf.setImage(with: url, for: .normal)
profileImageButton.kf.setImage(
with: imageURL,
for: .disabled,
placeholder: .imgProfile.withRenderingMode(.alwaysOriginal)
)
}

@objc
Expand Down

0 comments on commit 6f44185

Please sign in to comment.