From a0fc48f5914b229ac67bdb593afc5ad467e798df Mon Sep 17 00:00:00 2001 From: mmaybei Date: Thu, 18 Jul 2024 18:41:44 +0900 Subject: [PATCH 1/7] =?UTF-8?q?fea/#213=20=EB=82=B4=20=EB=AA=A8=EC=9E=84?= =?UTF-8?q?=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=EC=97=90=EC=84=9C=20=EB=AA=A8?= =?UTF-8?q?=EC=9E=84=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=20=EC=8B=9C=20meetingID=20=EC=A0=84=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MeetingList/ViewController/MeetingListViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift b/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift index 064f85bd..11eceae0 100644 --- a/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift +++ b/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift @@ -87,7 +87,7 @@ extension MeetingListViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let viewController = MeetingInfoViewController( viewModel: MeetingInfoViewModel( - meetingID: 1, + meetingID: viewModel.meetingList.value?.data?.meetings[indexPath.item].meetingID ?? 0, service: MockMeetingInfoService() ) ) From 64e7eb65ffa62e19582d2563c2c5d1ca5ab975aa Mon Sep 17 00:00:00 2001 From: mmaybei Date: Thu, 18 Jul 2024 18:42:12 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat/#213=20=EC=A4=80=EB=B9=84=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EB=B0=8F=20=EC=9D=B4=EB=8F=99=EC=8B=9C=EA=B0=84=20?= =?UTF-8?q?=EB=B6=84=20=EB=8B=A8=EC=9C=84=EB=A1=9C=20=EA=B3=84=EC=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/SetReadyInfoViewModel.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/KkuMulKum/Source/Promise/ReadyStatus/ViewModel/SetReadyInfoViewModel.swift b/KkuMulKum/Source/Promise/ReadyStatus/ViewModel/SetReadyInfoViewModel.swift index 8e40a3c0..840b0a6c 100644 --- a/KkuMulKum/Source/Promise/ReadyStatus/ViewModel/SetReadyInfoViewModel.swift +++ b/KkuMulKum/Source/Promise/ReadyStatus/ViewModel/SetReadyInfoViewModel.swift @@ -29,6 +29,16 @@ final class SetReadyInfoViewModel { } } + private func calculateTimes() { + let readyHours = Int(readyHour.value) ?? 0 + let readyMinutes = Int(readyMinute.value) ?? 0 + let moveHours = Int(moveHour.value) ?? 0 + let moveMinutes = Int(moveMinute.value) ?? 0 + + readyTime = readyHours * 60 + readyMinutes + moveTime = moveHours * 60 + moveMinutes + } + func updateTime(textField: String, time: String) { guard let time = Int(time) else { return } @@ -44,6 +54,8 @@ final class SetReadyInfoViewModel { default: break } + + calculateTimes() } func checkValid( From 1b3a2ee77b1a3184bfe54fc4adfe183204affa5a Mon Sep 17 00:00:00 2001 From: mmaybei Date: Thu, 18 Jul 2024 18:46:16 +0900 Subject: [PATCH 3/7] =?UTF-8?q?chore/#213=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MeetingList/ServiceType/MeetingListServiceType.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/KkuMulKum/Source/MeetingList/ServiceType/MeetingListServiceType.swift b/KkuMulKum/Source/MeetingList/ServiceType/MeetingListServiceType.swift index 60f444c7..d60cfa1c 100644 --- a/KkuMulKum/Source/MeetingList/ServiceType/MeetingListServiceType.swift +++ b/KkuMulKum/Source/MeetingList/ServiceType/MeetingListServiceType.swift @@ -13,6 +13,12 @@ protocol MeetingListServiceType { func fetchMeetingList() -> ResponseBodyDTO } +//extension MeetingService: MeetingListServiceType { +// func fetchMeetingList() -> ResponseBodyDTO { +// <#code#> +// } +//} + final class MockMeetingListService: MeetingListServiceType { func fetchMeetingList() -> ResponseBodyDTO { let mockData = ResponseBodyDTO( From ac8080d61ed0c2205083e4d199a3a3d0ac1deb4f Mon Sep 17 00:00:00 2001 From: mmaybei Date: Thu, 18 Jul 2024 18:56:51 +0900 Subject: [PATCH 4/7] =?UTF-8?q?chore/#213=20=EC=A3=BC=EC=84=9D=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MeetingList/ViewController/MeetingListViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift b/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift index 429a502b..f632d12e 100644 --- a/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift +++ b/KkuMulKum/Source/MeetingList/ViewController/MeetingListViewController.swift @@ -85,7 +85,6 @@ extension MeetingListViewController: UITableViewDelegate { } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - // TODO: MeetingID를 넘겨받기 let viewController = MeetingInfoViewController( viewModel: MeetingInfoViewModel( meetingID: viewModel.meetingList.value?.data?.meetings[indexPath.item].meetingID ?? 0, From 94205e22920bde3db941d97923e1e4cac0b74481 Mon Sep 17 00:00:00 2001 From: mmaybei Date: Thu, 18 Jul 2024 19:35:44 +0900 Subject: [PATCH 5/7] =?UTF-8?q?feat/#213=20=ED=99=88=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=20=EB=8B=A4=EA=B0=80=EC=98=AC=20=EC=95=BD=EC=86=8D=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=EC=A0=84=EB=8B=AC=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/ViewController/HomeViewController.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift index c1bdd3a9..4eb79a73 100644 --- a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift +++ b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift @@ -116,6 +116,20 @@ extension HomeViewController: UICollectionViewDelegateFlowLayout { ) -> UIEdgeInsets { return contentInset } + + func collectionView( + _ collectionView: UICollectionView, + didSelectItemAt indexPath: IndexPath + ) { + // TODO: promiseID를 모임 상세로 전달 +// let viewController = PromiseInfoViewController( +// viewModel: PromiseInfoViewModel( +// promiseID: viewModel.upcomingPromiseList.value?.data?.promises[indexPath.item].promiseID ?? 0, +// service: PromiseService() +// ) +// ) + //tabBarController?.navigationController?.pushViewController(viewController, animated: true) + } } From 0e5107003f3d6960942aa38ae997ef6f0475b860 Mon Sep 17 00:00:00 2001 From: mmaybei Date: Thu, 18 Jul 2024 19:44:35 +0900 Subject: [PATCH 6/7] =?UTF-8?q?feat/#213=20=ED=99=88=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=20=EC=98=A4=EB=8A=98=EC=9D=98=20=EC=95=BD=EC=86=8D=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=EC=A0=84=EB=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KkuMulKum/Source/Home/View/HomeView.swift | 2 +- .../ViewController/HomeViewController.swift | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/KkuMulKum/Source/Home/View/HomeView.swift b/KkuMulKum/Source/Home/View/HomeView.swift index 7d68da24..38db8bfa 100644 --- a/KkuMulKum/Source/Home/View/HomeView.swift +++ b/KkuMulKum/Source/Home/View/HomeView.swift @@ -64,7 +64,7 @@ final class HomeView: BaseView { $0.setText("다가올 나의 약속은?", style: .body01, color: .gray8) } - private let todayButton = UIButton().then { + let todayButton = UIButton().then { let icon = UIImage(resource: .iconRight) $0.setImage(icon, for: .normal) } diff --git a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift index 4eb79a73..57ceebdd 100644 --- a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift +++ b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift @@ -65,6 +65,11 @@ class HomeViewController: BaseViewController { } override func setupAction() { + rootView.todayButton.addTarget( + self, + action: #selector(todayButtonDidTap), + for: .touchUpInside + ) rootView.todayPromiseView.prepareButton.addTarget( self, action: #selector(prepareButtonDidTap), @@ -368,6 +373,18 @@ private extension HomeViewController { // MARK: - Action + @objc + func todayButtonDidTap(_ sender: UIButton) { + // TODO: promiseID를 모임 상세로 전달 +// let viewController = PromiseInfoViewController( +// viewModel: PromiseInfoViewModel( +// promiseID: viewModel.nearestPromise.value?.data?.promiseID ?? 0, +// service: PromiseService() +// ) +// ) + //tabBarController?.navigationController?.pushViewController(viewController, animated: true) + } + @objc func prepareButtonDidTap(_ sender: UIButton) { viewModel.updateState(newState: .prepare) From 336eda3397334445a9ad4da7ea258d2bc1e343b1 Mon Sep 17 00:00:00 2001 From: mmaybei Date: Thu, 18 Jul 2024 19:48:44 +0900 Subject: [PATCH 7/7] =?UTF-8?q?chore/#213=20=ED=99=95=EC=9D=B8=EC=9A=A9=20?= =?UTF-8?q?=ED=94=84=EB=A6=B0=ED=8A=B8=EB=AC=B8=20=EC=B6=94=EA=B0=80=20(?= =?UTF-8?q?=EB=82=98=EC=A4=91=EC=97=90=20=EC=82=AD=EC=A0=9C=20=EB=B0=94?= =?UTF-8?q?=EB=9E=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/Home/ViewController/HomeViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift index 57ceebdd..66b4e0b6 100644 --- a/KkuMulKum/Source/Home/ViewController/HomeViewController.swift +++ b/KkuMulKum/Source/Home/ViewController/HomeViewController.swift @@ -127,6 +127,10 @@ extension HomeViewController: UICollectionViewDelegateFlowLayout { didSelectItemAt indexPath: IndexPath ) { // TODO: promiseID를 모임 상세로 전달 + print( + "promiseID: ", + viewModel.upcomingPromiseList.value?.data?.promises[indexPath.item].promiseID ?? 0 + ) // let viewController = PromiseInfoViewController( // viewModel: PromiseInfoViewModel( // promiseID: viewModel.upcomingPromiseList.value?.data?.promises[indexPath.item].promiseID ?? 0, @@ -375,6 +379,10 @@ private extension HomeViewController { @objc func todayButtonDidTap(_ sender: UIButton) { + print( + "promiseID: ", + viewModel.nearestPromise.value?.data?.promiseID ?? 0 + ) // TODO: promiseID를 모임 상세로 전달 // let viewController = PromiseInfoViewController( // viewModel: PromiseInfoViewModel(