From 965688b3178331c283974c16ca529a6e27659b0f Mon Sep 17 00:00:00 2001 From: gom1n Date: Mon, 5 Jun 2023 10:09:44 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]=20#331=20=EB=91=90=20=EB=B2=88?= =?UTF-8?q?=EC=A7=B8=20=EA=B0=90=EC=A0=95=EC=9D=84=20=EB=82=A8=EA=B8=B0?= =?UTF-8?q?=EB=8A=94=20=ED=8E=98=EC=9D=B4=EC=A7=80=20>=20tableView=20deleg?= =?UTF-8?q?ate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Record/RecordSecondEmotionViewController.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/POME/Presentation/ViewControllers/Record/RecordSecondEmotionViewController.swift b/POME/Presentation/ViewControllers/Record/RecordSecondEmotionViewController.swift index 6dddec1..a9da74c 100644 --- a/POME/Presentation/ViewControllers/Record/RecordSecondEmotionViewController.swift +++ b/POME/Presentation/ViewControllers/Record/RecordSecondEmotionViewController.swift @@ -129,13 +129,7 @@ extension RecordSecondEmotionViewController: UITableViewDelegate, UITableViewDat } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let tag = indexPath.row - if tag > 0 { - let vc = SecondEmotionViewController() - vc.recordId = viewModel.records[dataIndexBy(indexPath)].id - self.navigationController?.pushViewController(vc, animated: true) - } - - tableView.deselectRow(at: indexPath, animated: true) + tag > 0 ? moveToSelectSecondEmotion(indexPath: indexPath) : tableView.deselectRow(at: indexPath, animated: true) } private func getGoalTableViewCell(indexPath: IndexPath) -> RecordEmotionTableViewCell{ @@ -152,6 +146,12 @@ extension RecordSecondEmotionViewController: UITableViewDelegate, UITableViewDat } } + private func moveToSelectSecondEmotion(indexPath: IndexPath) { + let vc = SecondEmotionViewController() + vc.recordId = viewModel.records[dataIndexBy(indexPath)].id + self.navigationController?.pushViewController(vc, animated: true) + } + } // MARK: - Record Cell delegate extension RecordSecondEmotionViewController: RecordCellDelegate{