From c6001f3f217d706a8de41ce9c476aa5150ed31b3 Mon Sep 17 00:00:00 2001 From: LeeSeungmin Date: Tue, 12 Mar 2024 13:39:07 +0900 Subject: [PATCH] =?UTF-8?q?[#69]Refactor:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C=20=EB=B0=8F?= =?UTF-8?q?=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Subviews/Cell/TagCollectionViewCell.swift | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/Projects/Features/Falling/Src/Subviews/Cell/TagCollectionViewCell.swift b/Projects/Features/Falling/Src/Subviews/Cell/TagCollectionViewCell.swift index 578112e3..7d9d3e90 100644 --- a/Projects/Features/Falling/Src/Subviews/Cell/TagCollectionViewCell.swift +++ b/Projects/Features/Falling/Src/Subviews/Cell/TagCollectionViewCell.swift @@ -77,29 +77,12 @@ final class TagCollectionViewCell: UICollectionViewCell { contentView.layer.masksToBounds = true } - func bind(_ viewModel: TagItemViewModel) { - self.titleLabel.text = viewModel.title - self.emojiView.text = viewModel.emoji + func bind(_ item: EmojiType) { + self.titleLabel.text = item.name + self.emojiView.text = item.emojiCode.unicodeToEmoji() } } -struct TagItemViewModel { - let emojiCode: String - let title: String - - var emoji: String { - emojiCode.unicodeToEmoji() - } - init(_ idealType: EmojiType) { - self.title = idealType.name - self.emojiCode = idealType.emojiCode - } - - init(emojiCode: String, title: String) { - self.emojiCode = emojiCode - self.title = title - } -} #if canImport(SwiftUI) && DEBUG import SwiftUI