diff --git a/Dear-World/Dear-World/Source/Presentation/Scene/Cheering Map/Cell/RankerTableViewCell.swift b/Dear-World/Dear-World/Source/Presentation/Scene/Cheering Map/Cell/RankerTableViewCell.swift index ceeb4cb..49d1006 100644 --- a/Dear-World/Dear-World/Source/Presentation/Scene/Cheering Map/Cell/RankerTableViewCell.swift +++ b/Dear-World/Dear-World/Source/Presentation/Scene/Cheering Map/Cell/RankerTableViewCell.swift @@ -72,7 +72,7 @@ final class RankerTableViewCell: UITableViewCell { $0.textColor = .warmBlue } countryNameLabel.snp.makeConstraints { - $0.top.equalToSuperview().inset(14) + $0.top.equalToSuperview().inset(12) $0.leading.equalTo(countryFlagImageView.snp.trailing).offset(10) } diff --git a/Dear-World/Dear-World/Source/Presentation/Scene/Discover/Cell/MessageTableViewCell.swift b/Dear-World/Dear-World/Source/Presentation/Scene/Discover/Cell/MessageTableViewCell.swift index 4aa824c..bd724ad 100644 --- a/Dear-World/Dear-World/Source/Presentation/Scene/Discover/Cell/MessageTableViewCell.swift +++ b/Dear-World/Dear-World/Source/Presentation/Scene/Discover/Cell/MessageTableViewCell.swift @@ -12,9 +12,10 @@ import UIKit final class MessageTableViewCell: UITableViewCell { let disposeBag: DisposeBag = DisposeBag() // MARK: 🖼 UI - let emojiLabel: UILabel = UILabel() + let emojiImageView: UIImageView = UIImageView() let nameLabel: UILabel = UILabel() let countryLabel: UILabel = UILabel() + let countryFlagImageView: UIImageView = UIImageView() let detailTextView: UITextView = UITextView() let likeView: UIImageView = UIImageView() let likeCountLabel: UILabel = UILabel() @@ -78,13 +79,8 @@ final class MessageTableViewCell: UITableViewCell { $0.height.width.equalTo(40) } - self.emojiLabel.do { - $0.text = "🎅🏻" - $0.font = .systemFont(ofSize: 14) - $0.textAlignment = .center - } - mainView.addSubview(self.emojiLabel) - self.emojiLabel.snp.makeConstraints { + mainView.addSubview(emojiImageView) + emojiImageView.snp.makeConstraints { $0.size.equalTo(20) $0.center.equalTo(emojiView) } @@ -101,15 +97,21 @@ final class MessageTableViewCell: UITableViewCell { $0.trailing.greaterThanOrEqualToSuperview().inset(30) } + mainView.addSubview(countryFlagImageView) + countryFlagImageView.snp.makeConstraints { + $0.bottom.equalTo(emojiView.snp.bottom) + $0.leading.equalTo(emojiView.snp.trailing).offset(10) + $0.width.height.equalTo(18) + } self.countryLabel.do { - $0.text = "🇰🇷 South Korea" + $0.text = "South Korea" $0.font = .boldSystemFont(ofSize: 12) $0.textColor = .grayWhite } mainView.addSubview(self.countryLabel) self.countryLabel.snp.makeConstraints { - $0.bottom.equalTo(emojiView.snp.bottom) - $0.leading.equalTo(emojiView.snp.trailing).offset(10) + $0.centerY.equalTo(countryFlagImageView) + $0.leading.equalTo(countryFlagImageView.snp.trailing).offset(10) $0.trailing.greaterThanOrEqualToSuperview().inset(30) } diff --git a/Dear-World/Dear-World/Source/Presentation/Scene/Discover/DiscoverViewController.swift b/Dear-World/Dear-World/Source/Presentation/Scene/Discover/DiscoverViewController.swift index b2f4497..cb356d7 100644 --- a/Dear-World/Dear-World/Source/Presentation/Scene/Discover/DiscoverViewController.swift +++ b/Dear-World/Dear-World/Source/Presentation/Scene/Discover/DiscoverViewController.swift @@ -325,11 +325,17 @@ extension DiscoverViewController: UITableViewDelegate, UITableViewDataSource { cell.do { let cellMessage = self.messages[indexPath.row] $0.nameLabel.text = cellMessage.user.nickname - $0.emojiLabel.text = cellMessage.user.emoji.unicode + $0.detailTextView.text = cellMessage.content $0.likeCount = cellMessage.likeCount $0.isLike = cellMessage.isLiked - $0.countryLabel.text = cellMessage.user.country.emojiUnicode + $0.countryLabel.text = cellMessage.user.country.fullName + if let emojiImageURL: URL = URL(string: cellMessage.user.emoji.imageURL) { + $0.emojiImageView.kf.setImage(with: emojiImageURL) + } + if let countryImageURL: URL = URL(string: cellMessage.user.country.imageURL) { + $0.countryFlagImageView.kf.setImage(with: countryImageURL) + } $0.messageId = cellMessage.id } bindShareButton(button: cell.shareButton) diff --git a/Dear-World/Dear-World/Source/Presentation/Scene/Main/Message.Model.Messages.swift b/Dear-World/Dear-World/Source/Presentation/Scene/Main/Message.Model.Messages.swift index b46c0c9..73d91f0 100644 --- a/Dear-World/Dear-World/Source/Presentation/Scene/Main/Message.Model.Messages.swift +++ b/Dear-World/Dear-World/Source/Presentation/Scene/Main/Message.Model.Messages.swift @@ -45,8 +45,15 @@ extension Message.Model { let country: Country let nickname: String let emoji: Emoji + struct Emoji: Decodable { let unicode: String + let imageURL: String + + enum CodingKeys: String, CodingKey { + case unicode + case imageURL = "imageUrl" + } } }