From 7b774d06cab7ea275390889e79121984687e9f7f Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 8 Dec 2024 14:29:29 +0900 Subject: [PATCH 1/6] =?UTF-8?q?:bug:=20::=20[#1330]=20FAQ=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20number=20of=20lines=20=EC=A0=81=EC=9A=A9?= =?UTF-8?q?=20=EC=95=88=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Views/QuestionTableViewCell.swift | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift index 55535f824..a02028319 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift @@ -9,12 +9,21 @@ class QuestionTableViewCell: UITableViewCell { 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) + 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) } + } } } From 734983d789e1ed1a2db1878f66f0e5d2101f6ebd Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 8 Dec 2024 14:29:33 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Views/QuestionTableViewCell.swift | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift index a02028319..51906e847 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift @@ -9,21 +9,21 @@ class QuestionTableViewCell: UITableViewCell { 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) + 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) + } } - } 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) - } - } } } From bf361f811f2e07e34648c796cee7e51f6a002c7d Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 8 Dec 2024 14:35:04 +0900 Subject: [PATCH 3/6] :truck: :: [#1330] rename QNA -> FAQ --- .../{QnaContentViewModel.swift => FAQContentViewModel.swift} | 5 ++++- .../{QuestionTableViewCell.swift => FAQTableViewCell.swift} | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) rename Projects/Features/MyInfoFeature/Sources/ViewModels/{QnaContentViewModel.swift => FAQContentViewModel.swift} (66%) rename Projects/Features/MyInfoFeature/Sources/Views/{QuestionTableViewCell.swift => FAQTableViewCell.swift} (86%) diff --git a/Projects/Features/MyInfoFeature/Sources/ViewModels/QnaContentViewModel.swift b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift similarity index 66% rename from Projects/Features/MyInfoFeature/Sources/ViewModels/QnaContentViewModel.swift rename to Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift index ef646a4d1..a485e8a7c 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewModels/QnaContentViewModel.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift @@ -5,7 +5,10 @@ import RxRelay import RxSwift import Utility -public final class QnaContentViewModel: ViewModelType { +@available(*, deprecated, renamed: "FAQContentViewModel", message: "QnaContentViewModel is deprecated, use FAQContentViewModel instead.") +typealias QnaContentViewModel = FAQContentViewModel + +public final class FAQContentViewModel: ViewModelType { var disposeBag = DisposeBag() var dataSource: [FaqEntity] diff --git a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift similarity index 86% rename from Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift rename to Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift index 51906e847..8546a48ca 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/QuestionTableViewCell.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift @@ -2,7 +2,10 @@ import DesignSystem import FaqDomainInterface import UIKit -class QuestionTableViewCell: UITableViewCell { +@available(*, deprecated, renamed: "FAQTableViewCell", message: "QuestionTableViewCell is deprecated, use FAQTableViewCell instead.") +typealias QuestionTableViewCell = FAQTableViewCell + +class FAQTableViewCell: UITableViewCell { @IBOutlet weak var categoryLabel: UILabel! @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var expandImageView: UIImageView! From c0c29bdc35356b3d1e019bff0e3ff63308016c66 Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 8 Dec 2024 14:35:08 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/ViewModels/FAQContentViewModel.swift | 7 ++++++- .../Sources/Views/FAQTableViewCell.swift | 11 ++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift index a485e8a7c..fa9fe1c23 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift @@ -5,7 +5,12 @@ import RxRelay import RxSwift import Utility -@available(*, deprecated, renamed: "FAQContentViewModel", message: "QnaContentViewModel is deprecated, use FAQContentViewModel instead.") +@available( + *, + deprecated, + renamed: "FAQContentViewModel", + message: "QnaContentViewModel is deprecated, use FAQContentViewModel instead." +) typealias QnaContentViewModel = FAQContentViewModel public final class FAQContentViewModel: ViewModelType { diff --git a/Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift index 8546a48ca..1f2f52656 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift @@ -2,7 +2,12 @@ import DesignSystem import FaqDomainInterface import UIKit -@available(*, deprecated, renamed: "FAQTableViewCell", message: "QuestionTableViewCell is deprecated, use FAQTableViewCell instead.") +@available( + *, + deprecated, + renamed: "FAQTableViewCell", + message: "QuestionTableViewCell is deprecated, use FAQTableViewCell instead." +) typealias QuestionTableViewCell = FAQTableViewCell class FAQTableViewCell: UITableViewCell { @@ -30,8 +35,8 @@ class FAQTableViewCell: UITableViewCell { } } -extension QuestionTableViewCell { - public func update(model: FaqEntity) { +public extension QuestionTableViewCell { + func update(model: FaqEntity) { categoryLabel.text = model.category titleLabel.text = model.question expandImageView.image = model.isOpen ? DesignSystemAsset.Navigation.fold.image : DesignSystemAsset.Navigation From d3cab9e7ce60d583c02ffe2b338c8b765fbb058e Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 8 Dec 2024 14:47:50 +0900 Subject: [PATCH 5/6] :truck: :: [#1330] QNA -> FAQ --- .../MyInfoFeature/Resources/Faq.storyboard | 8 +++--- .../FAQ/FaqContentViewController.swift | 8 +++--- .../ViewModels/FAQContentViewModel.swift | 8 ------ .../Sources/Views/AnswerTableViewCell.swift | 21 -------------- .../Views/FAQAnswerTableViewCell.swift | 28 +++++++++++++++++++ ...l.swift => FAQQuestionTableViewCell.swift} | 12 ++------ 6 files changed, 38 insertions(+), 47 deletions(-) delete mode 100644 Projects/Features/MyInfoFeature/Sources/Views/AnswerTableViewCell.swift create mode 100644 Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift rename Projects/Features/MyInfoFeature/Sources/Views/{FAQTableViewCell.swift => FAQQuestionTableViewCell.swift} (82%) 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..f1307eb95 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,12 @@ 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/FAQContentViewModel.swift b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift index fa9fe1c23..96b52402e 100644 --- a/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift +++ b/Projects/Features/MyInfoFeature/Sources/ViewModels/FAQContentViewModel.swift @@ -5,14 +5,6 @@ import RxRelay import RxSwift import Utility -@available( - *, - deprecated, - renamed: "FAQContentViewModel", - message: "QnaContentViewModel is deprecated, use FAQContentViewModel instead." -) -typealias QnaContentViewModel = FAQContentViewModel - 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..39592a265 --- /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/FAQTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/FAQQuestionTableViewCell.swift similarity index 82% rename from Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift rename to Projects/Features/MyInfoFeature/Sources/Views/FAQQuestionTableViewCell.swift index 1f2f52656..a341b7aff 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/FAQTableViewCell.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/FAQQuestionTableViewCell.swift @@ -2,15 +2,7 @@ import DesignSystem import FaqDomainInterface import UIKit -@available( - *, - deprecated, - renamed: "FAQTableViewCell", - message: "QuestionTableViewCell is deprecated, use FAQTableViewCell instead." -) -typealias QuestionTableViewCell = FAQTableViewCell - -class FAQTableViewCell: UITableViewCell { +final class FAQQuestionTableViewCell: UITableViewCell { @IBOutlet weak var categoryLabel: UILabel! @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var expandImageView: UIImageView! @@ -35,7 +27,7 @@ class FAQTableViewCell: UITableViewCell { } } -public extension QuestionTableViewCell { +extension FAQQuestionTableViewCell { func update(model: FaqEntity) { categoryLabel.text = model.category titleLabel.text = model.question From 30c378018e7d52f43758badc1e25dde4fd381a8a Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 8 Dec 2024 14:47:56 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=8E=A8=20::=20=EC=BD=94=EB=93=9C=20Fo?= =?UTF-8?q?rmatting=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FAQ/FaqContentViewController.swift | 10 +++++++--- .../Views/FAQAnswerTableViewCell.swift | 20 +++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Projects/Features/MyInfoFeature/Sources/ViewControllers/FAQ/FaqContentViewController.swift b/Projects/Features/MyInfoFeature/Sources/ViewControllers/FAQ/FaqContentViewController.swift index f1307eb95..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: FAQContentViewModel! + var viewModel: FAQContentViewModel! override public func viewDidLoad() { super.viewDidLoad() @@ -71,12 +71,16 @@ extension FaqContentViewController: UITableViewDataSource { public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let questionCell = tableView - .dequeueReusableCell(withIdentifier: "FAQQuestionTableViewCell", for: indexPath) as? FAQQuestionTableViewCell + .dequeueReusableCell( + withIdentifier: "FAQQuestionTableViewCell", + for: indexPath + ) as? FAQQuestionTableViewCell else { return UITableViewCell() } guard let answerCell = tableView - .dequeueReusableCell(withIdentifier: "FAQAnswerTableViewCell", for: indexPath) as? FAQAnswerTableViewCell else { + .dequeueReusableCell(withIdentifier: "FAQAnswerTableViewCell", for: indexPath) as? FAQAnswerTableViewCell + else { return UITableViewCell() } diff --git a/Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift b/Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift index 39592a265..fc90fb4d7 100644 --- a/Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift +++ b/Projects/Features/MyInfoFeature/Sources/Views/FAQAnswerTableViewCell.swift @@ -7,17 +7,17 @@ final class FAQAnswerTableViewCell: UITableViewCell { 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) + 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) + } } - } else { - Task { @MainActor in - answerLabel.font = DesignSystemFontFamily.Pretendard.medium.font(size: 14) - answerLabel.setTextWithAttributes(kernValue: -0.5, lineSpacing: 6) - } - } } }