From cf4b205be97db2dcf9c19eb22c41fe0be0c75024 Mon Sep 17 00:00:00 2001 From: mcrkgus Date: Thu, 14 Nov 2024 16:18:19 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20#292=20-=20viewWillAppear=20update=20?= =?UTF-8?q?=EB=B0=A9=EB=B2=95=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Present/Home/View/HomeViewController.swift | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Hankkijogbo/Hankkijogbo/Present/Home/View/HomeViewController.swift b/Hankkijogbo/Hankkijogbo/Present/Home/View/HomeViewController.swift index 0e6cd1e7..33f090bc 100644 --- a/Hankkijogbo/Hankkijogbo/Present/Home/View/HomeViewController.swift +++ b/Hankkijogbo/Hankkijogbo/Present/Home/View/HomeViewController.swift @@ -198,26 +198,12 @@ extension HomeViewController { } private extension HomeViewController { - func loadInitialData() { - universityId = UserDefaults.standard.getUniversity()?.id - viewModel.getHankkiListAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "") { [weak self] success in - let isEmpty = self?.viewModel.hankkiLists.isEmpty ?? true - self?.viewModel.onHankkiListFetchCompletion?(success, isEmpty) - } - viewModel.getHankkiPinAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "", completion: { _ in }) - } - func updateUniversityData() { let universityId = UserDefaults.standard.getUniversity()?.id - viewModel.getHankkiListAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "") { [weak self] success in - let isEmpty = self?.viewModel.hankkiLists.isEmpty ?? true - self?.viewModel.onHankkiListFetchCompletion?(success, isEmpty) - } - viewModel.getHankkiPinAPI(universityId: universityId, storeCategory: "", priceCategory: "", sortOption: "", completion: { _ in }) - rootView.bottomSheetView.totalListCollectionView.reloadData() + viewModel.updateHankkiList() - // 대학 선택 후 홈화면 재진입 시 해당 대학교에 맞게 reset + rootView.bottomSheetView.totalListCollectionView.reloadData() hideMarkerInfoCard() rootView.bottomSheetView.viewLayoutIfNeededWithDownAnimation() }