diff --git a/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift b/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift index 5fe10adb..9afe2f44 100644 --- a/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift +++ b/DontBe-iOS/DontBe-iOS/Global/Literals/StringLiterals.swift @@ -170,7 +170,6 @@ enum StringLiterals { enum Loading { static let loadingMessageTitle = "알고 계셨나요?" - static let loadingMessage1 = "온라인 상에서도 비속어를\n사용하지 않은 사람들이\n실제 행복지수가 더 높다고 해요." static let loadingMessage2 = "Don’t be는 그저 온화한 커뮤니티가 아닌\n온화하면서도 재밌을 수 있는 커뮤니티를 지향해요." static let loadingMessage3 = "Don’t be의 온화함을 해치는 글이 보인다면\n직접 투명도 기능을 눌러보세요!" static let loadingMessage4 = "Don’t be 팀은 온화한 커뮤니티를 만들기 위해\n저희부터 온화한 팀이 되고자 노력하고 있어요." diff --git a/DontBe-iOS/DontBe-iOS/Presentation/Helpers/DontBeLoadingView.swift b/DontBe-iOS/DontBe-iOS/Presentation/Helpers/DontBeLoadingView.swift index 75c406c1..8b05bc43 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/Helpers/DontBeLoadingView.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/Helpers/DontBeLoadingView.swift @@ -12,8 +12,7 @@ import Lottie final class DontBeLoadingView: UIView { private var loadingText: String = "" - private var loadingTexts = [StringLiterals.Loading.loadingMessage1, - StringLiterals.Loading.loadingMessage2, + private var loadingTexts = [StringLiterals.Loading.loadingMessage2, StringLiterals.Loading.loadingMessage3, StringLiterals.Loading.loadingMessage4, StringLiterals.Loading.loadingMessage5, diff --git a/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift b/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift index 1239b3b1..3871e8ce 100644 --- a/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift +++ b/DontBe-iOS/DontBe-iOS/Presentation/TabBar/DontBeTabBarController.swift @@ -148,20 +148,27 @@ final class DontBeTabBarController: UITabBarController { extension DontBeTabBarController: UITabBarControllerDelegate { func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { - if selectedIndex == 1 { - self.selectedIndex = 0 - } - if selectedIndex == 2 { self.tabBar.items?[2].image = ImageLiterals.TabBar.icnNotificationRead } - if beforeIndex == 2 && self.selectedIndex == 0 { - showLoadingView() + if beforeIndex == 2 { + if self.selectedIndex == 0 { + showLoadingView() + print("여기는 \(self.selectedIndex)") + } + } + + if beforeIndex == 3 { + if self.selectedIndex == 0 { + showLoadingView() + print("여기는 \(self.selectedIndex)") + } } - if beforeIndex == 3 && self.selectedIndex == 0 { - showLoadingView() + if selectedIndex == 1 { + self.selectedIndex = 0 + hideLoadingView() } if let selectedViewController = tabBarController.selectedViewController { @@ -215,8 +222,14 @@ extension DontBeTabBarController { loadingView.show() DispatchQueue.main.asyncAfter(deadline: .now() + 1.4) { - loadingView.hide { - } + loadingView.hide() } } + + private func hideLoadingView() { + let loadingView = DontBeLoadingView() + DispatchQueue.main.async { + loadingView.hide() + } + } }