diff --git a/Projects/Features/MyInfoFeature/Resources/Faq.storyboard b/Projects/Features/MyInfoFeature/Resources/Faq.storyboard index 3e3a29484..6996197da 100644 --- a/Projects/Features/MyInfoFeature/Resources/Faq.storyboard +++ b/Projects/Features/MyInfoFeature/Resources/Faq.storyboard @@ -1,9 +1,9 @@ - + - + @@ -96,7 +96,7 @@ - + @@ -158,7 +158,7 @@ - + diff --git a/Projects/Features/MyInfoFeature/Sources/ViewControllers/FAQ/FaqContentViewController.swift b/Projects/Features/MyInfoFeature/Sources/ViewControllers/FAQ/FaqContentViewController.swift index 7b4c0c542..596c91dd5 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewControllers/FAQ/FaqContentViewController.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewControllers/FAQ/FaqContentViewController.swift @@ -9,7 +9,7 @@ import Utility public final class FaqContentViewController: UIViewController, ViewControllerFromStoryBoard { @IBOutlet weak var tableView: UITableView! - var viewModel: QnaContentViewModel! + var viewModel: FAQContentViewModel! override public func viewDidLoad() { super.viewDidLoad() @@ -21,7 +21,7 @@ public final class FaqContentViewController: UIViewController, ViewControllerFro navigationController?.interactivePopGestureRecognizer?.delegate = nil // 스와이프로 뒤로가기 } - public static func viewController(viewModel: QnaContentViewModel) -> FaqContentViewController { + public static func viewController(viewModel: FAQContentViewModel) -> FaqContentViewController { let viewController = FaqContentViewController.viewController(storyBoardName: "Faq", bundle: Bundle.module) viewController.viewModel = viewModel return viewController @@ -71,12 +71,16 @@ extension FaqContentViewController: UITableViewDataSource { public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let questionCell = tableView - .dequeueReusableCell(withIdentifier: "QuestionTableViewCell", for: indexPath) as? QuestionTableViewCell + .dequeueReusableCell( + withIdentifier: "FAQQuestionTableViewCell", + for: indexPath + ) as? FAQQuestionTableViewCell else { return UITableViewCell() } guard let answerCell = tableView - .dequeueReusableCell(withIdentifier: "AnswerTableViewCell", for: indexPath) as? AnswerTableViewCell else { + .dequeueReusableCell(withIdentifier: "FAQAnswerTableViewCell", for: indexPath) as? FAQAnswerTableViewCell + else { return UITableViewCell() } diff --git a/Projects/Features/MyInfoFeature/Sources/ViewModels/QnaContentViewModel.swift b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift similarity index 89% rename from Projects/Features/MyInfoFeature/Sources/ViewModels/QnaContentViewModel.swift rename to Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift index ef646a4d1..96b52402e 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewModels/QnaContentViewModel.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift @@ -5,7 +5,7 @@ import RxRelay import RxSwift import Utility -public final class QnaContentViewModel: ViewModelType { +public final class FAQContentViewModel: ViewModelType { var disposeBag = DisposeBag() var dataSource: [FaqEntity] diff --git a/Projects/Features/MyInfoFeature/Sources/Views/AnswerTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/AnswerTableViewCell.swift deleted file mode 100644 index b34bf264d..000000000 --- a/Projects/Features/MyInfoFeature/Sources/Views/AnswerTableViewCell.swift +++ /dev/null @@ -1,21 +0,0 @@ -import DesignSystem -import FaqDomainInterface -import UIKit - -class AnswerTableViewCell: UITableViewCell { - @IBOutlet weak var answerLabel: UILabel! - - override func awakeFromNib() { - super.awakeFromNib() - Task { @MainActor in - answerLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14) - answerLabel.setTextWithAttributes(kernValue: -0.5, lineSpacing: 6) - } - } -} - -extension AnswerTableViewCell { - public func update(model: FaqEntity) { - answerLabel.text = model.answer - } -} diff --git a/Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift new file mode 100644 index 000000000..fc90fb4d7 --- /dev/null +++ b/Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift @@ -0,0 +1,28 @@ +import DesignSystem +import FaqDomainInterface +import UIKit + +final class FAQAnswerTableViewCell: UITableViewCell { + @IBOutlet weak var answerLabel: UILabel! + + override func awakeFromNib() { + super.awakeFromNib() + if Thread.isMainThread { + MainActor.assumeIsolated { + answerLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14) + answerLabel.setTextWithAttributes(kernValue: -0.5, lineSpacing: 6) + } + } else { + Task { @MainActor in + answerLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14) + answerLabel.setTextWithAttributes(kernValue: -0.5, lineSpacing: 6) + } + } + } +} + +extension FAQAnswerTableViewCell { + public func update(model: FaqEntity) { + answerLabel.text = model.answer + } +} diff --git a/Projects/Features/MyInfoFeature/Sources/Views/FAQQuestionTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/FAQQuestionTableViewCell.swift new file mode 100644 index 000000000..a341b7aff --- /dev/null +++ b/Projects/Features/MyInfoFeature/Sources/Views/FAQQuestionTableViewCell.swift @@ -0,0 +1,37 @@ +import DesignSystem +import FaqDomainInterface +import UIKit + +final class FAQQuestionTableViewCell: UITableViewCell { + @IBOutlet weak var categoryLabel: UILabel! + @IBOutlet weak var titleLabel: UILabel! + @IBOutlet weak var expandImageView: UIImageView! + + override func awakeFromNib() { + super.awakeFromNib() + if Thread.isMainThread { + MainActor.assumeIsolated { + categoryLabel.font = DesignSystemFontFamily.Pretendard.light.font(size: 12) + categoryLabel.setTextWithAttributes(kernValue: -0.5) + titleLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 16) + titleLabel.setTextWithAttributes(kernValue: -0.5, lineSpacing: 5) + } + } else { + Task { @MainActor in + categoryLabel.font = DesignSystemFontFamily.Pretendard.light.font(size: 12) + categoryLabel.setTextWithAttributes(kernValue: -0.5) + titleLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 16) + titleLabel.setTextWithAttributes(kernValue: -0.5, lineSpacing: 5) + } + } + } +} + +extension FAQQuestionTableViewCell { + func update(model: FaqEntity) { + categoryLabel.text = model.category + titleLabel.text = model.question + expandImageView.image = model.isOpen ? DesignSystemAsset.Navigation.fold.image : DesignSystemAsset.Navigation + .close.image + } +} diff --git a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift deleted file mode 100644 index 55535f824..000000000 --- a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift +++ /dev/null @@ -1,28 +0,0 @@ -import DesignSystem -import FaqDomainInterface -import UIKit - -class QuestionTableViewCell: UITableViewCell { - @IBOutlet weak var categoryLabel: UILabel! - @IBOutlet weak var titleLabel: UILabel! - @IBOutlet weak var expandImageView: UIImageView! - - override func awakeFromNib() { - super.awakeFromNib() - Task { @MainActor in - categoryLabel.font = DesignSystemFontFamily.Pretendard.light.font(size: 12) - categoryLabel.setTextWithAttributes(kernValue: -0.5) - titleLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 16) - titleLabel.setTextWithAttributes(kernValue: -0.5, lineSpacing: 5) - } - } -} - -extension QuestionTableViewCell { - public func update(model: FaqEntity) { - categoryLabel.text = model.category - titleLabel.text = model.question - expandImageView.image = model.isOpen ? DesignSystemAsset.Navigation.fold.image : DesignSystemAsset.Navigation - .close.image - } -}