diff --git a/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift b/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift index cbbc1929..334f50a8 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/Home/ViewControllers/HomeViewController.swift @@ -87,12 +87,6 @@ final class HomeViewController: UIViewController { self.navigationController?.navigationBar.isHidden = true self.tabBarController?.tabBar.isHidden = false - if !hasAppearedBefore { - hasAppearedBefore = true - } else { - showLoadingView() - } - bindViewModel() setNotification() } @@ -129,18 +123,6 @@ extension HomeViewController { deletePostPopupVC.modalPresentationStyle = .overFullScreen } - private func showLoadingView() { - let loadingView = DontBeLoadingView() - print("로딩 시작!") - loadingView.show() - - DispatchQueue.main.asyncAfter(deadline: .now() + 3) { - loadingView.hide { - print("로딩 끝!") - } - } - } - private func setHierarchy() { view.addSubviews(homeCollectionView) } diff --git a/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift b/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift index 1c876f0f..1239b3b1 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift @@ -156,6 +156,14 @@ extension DontBeTabBarController: UITabBarControllerDelegate { self.tabBar.items?[2].image = ImageLiterals.TabBar.icnNotificationRead } + if beforeIndex == 2 && self.selectedIndex == 0 { + showLoadingView() + } + + if beforeIndex == 3 && self.selectedIndex == 0 { + showLoadingView() + } + if let selectedViewController = tabBarController.selectedViewController { applyFontColorAttributes(to: selectedViewController.tabBarItem, isSelected: true) } @@ -200,3 +208,15 @@ extension DontBeTabBarController: UITabBarControllerDelegate { return true } } + +extension DontBeTabBarController { + private func showLoadingView() { + let loadingView = DontBeLoadingView() + loadingView.show() + + DispatchQueue.main.asyncAfter(deadline: .now() + 1.4) { + loadingView.hide { + } + } + } +}