Skip to content

Commit

Permalink
[refactor] #331 두 번째 감정을 남기는 페이지 > tableView delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
gom1n committed Jun 5, 2023
1 parent 341fcc6 commit 965688b
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand Down

0 comments on commit 965688b

Please sign in to comment.