diff --git a/LionHeart-iOS/LionHeart-iOS.xcodeproj/project.pbxproj b/LionHeart-iOS/LionHeart-iOS.xcodeproj/project.pbxproj index d043e9ee..58dcf034 100644 --- a/LionHeart-iOS/LionHeart-iOS.xcodeproj/project.pbxproj +++ b/LionHeart-iOS/LionHeart-iOS.xcodeproj/project.pbxproj @@ -41,7 +41,6 @@ B532E8342A5525C600F0DB19 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B532E8332A5525C600F0DB19 /* SceneDelegate.swift */; }; B532E83B2A5525C700F0DB19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B532E83A2A5525C700F0DB19 /* Assets.xcassets */; }; B532E83E2A5525C700F0DB19 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B532E83C2A5525C700F0DB19 /* LaunchScreen.storyboard */; }; - B532E8492A5525C800F0DB19 /* LionHeart_iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B532E8482A5525C800F0DB19 /* LionHeart_iOSTests.swift */; }; B532E8532A5525C800F0DB19 /* LionHeart_iOSUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B532E8522A5525C800F0DB19 /* LionHeart_iOSUITests.swift */; }; B532E8552A5525C800F0DB19 /* LionHeart_iOSUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B532E8542A5525C800F0DB19 /* LionHeart_iOSUITestsLaunchTests.swift */; }; B532E8632A5529B000F0DB19 /* HTTPHeaderField.swift in Sources */ = {isa = PBXBuildFile; fileRef = B532E8622A5529B000F0DB19 /* HTTPHeaderField.swift */; }; @@ -116,11 +115,11 @@ B5F323E92A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F323E82A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift */; }; C003CC1B2AD9176B00AFFAAC /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC1A2AD9176B00AFFAAC /* Coordinator.swift */; }; C003CC1D2AD917CF00AFFAAC /* AppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC1C2AD917CF00AFFAAC /* AppCoordinator.swift */; }; - C003CC1F2AD917F900AFFAAC /* SplashCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC1E2AD917F900AFFAAC /* SplashCoordinator.swift */; }; + C003CC1F2AD917F900AFFAAC /* SplashCoordinatorImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC1E2AD917F900AFFAAC /* SplashCoordinatorImpl.swift */; }; C003CC212AD9181600AFFAAC /* TodayCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC202AD9181600AFFAAC /* TodayCoordinator.swift */; }; - C003CC232AD9183600AFFAAC /* AuthCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC222AD9183600AFFAAC /* AuthCoordinator.swift */; }; + C003CC232AD9183600AFFAAC /* AuthCoordinatorImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC222AD9183600AFFAAC /* AuthCoordinatorImpl.swift */; }; C003CC252AD9184700AFFAAC /* TabbbarCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC242AD9184700AFFAAC /* TabbbarCoordinator.swift */; }; - C003CC272AD9185A00AFFAAC /* ArticleCategoryCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC262AD9185A00AFFAAC /* ArticleCategoryCoordinator.swift */; }; + C003CC272AD9185A00AFFAAC /* ArticleCategoryCoordinatorImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC262AD9185A00AFFAAC /* ArticleCategoryCoordinatorImpl.swift */; }; C003CC292AD9186B00AFFAAC /* CurriculumCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC282AD9186B00AFFAAC /* CurriculumCoordinator.swift */; }; C003CC2B2AD9187B00AFFAAC /* ChallengeCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC2A2AD9187B00AFFAAC /* ChallengeCoordinator.swift */; }; C003CC2D2AD9189100AFFAAC /* BookmarkCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C003CC2C2AD9189100AFFAAC /* BookmarkCoordinator.swift */; }; @@ -167,6 +166,14 @@ C009E9FA2ADBC4DE00112F18 /* BookmarkViewControllerable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C009E9F92ADBC4DE00112F18 /* BookmarkViewControllerable.swift */; }; C009E9FC2ADBC4FD00112F18 /* ChallengeViewControllerable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C009E9FB2ADBC4FD00112F18 /* ChallengeViewControllerable.swift */; }; C009E9FE2ADBC51400112F18 /* ArticleCategoryViewControllerable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C009E9FD2ADBC51400112F18 /* ArticleCategoryViewControllerable.swift */; }; + C034EDD62ADE21BD00AD6FF3 /* SplashCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C034EDD52ADE21BD00AD6FF3 /* SplashCoordinator.swift */; }; + C034EDD82ADE21D200AD6FF3 /* SplashAdaptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C034EDD72ADE21D200AD6FF3 /* SplashAdaptor.swift */; }; + C034EDDA2ADE2A0E00AD6FF3 /* AuthCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C034EDD92ADE2A0E00AD6FF3 /* AuthCoordinator.swift */; }; + C034EDDC2ADE2A2C00AD6FF3 /* AuthAdaptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C034EDDB2ADE2A2C00AD6FF3 /* AuthAdaptor.swift */; }; + C034EDDE2ADE2F3500AD6FF3 /* ArticleListByCategoryViewControllerable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C034EDDD2ADE2F3500AD6FF3 /* ArticleListByCategoryViewControllerable.swift */; }; + C034EDE02ADE3A4A00AD6FF3 /* LionHeart_iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B532E8482A5525C800F0DB19 /* LionHeart_iOSTests.swift */; }; + C034EE1E2ADE44E200AD6FF3 /* ArticleCategoryAdaptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C034EE1D2ADE44E200AD6FF3 /* ArticleCategoryAdaptor.swift */; }; + C034EE202ADE450600AD6FF3 /* ArticleCategoryCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C034EE1F2ADE450600AD6FF3 /* ArticleCategoryCoordinator.swift */; }; C04BE3AD2ADD4F5D001967B5 /* TodayCoordinatorImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04BE3AC2ADD4F5D001967B5 /* TodayCoordinatorImpl.swift */; }; C04BE3AF2ADD4F7F001967B5 /* TodayAdaptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04BE3AE2ADD4F7F001967B5 /* TodayAdaptor.swift */; }; C065F0032ADBD2270094912C /* AuthFactoryImpl.swift in Sources */ = {isa = PBXBuildFile; fileRef = C065F0022ADBD2270094912C /* AuthFactoryImpl.swift */; }; @@ -420,11 +427,11 @@ B5F323E82A6A8F0000047869 /* CurriculumWeekBackgroundDummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurriculumWeekBackgroundDummy.swift; sourceTree = ""; }; C003CC1A2AD9176B00AFFAAC /* Coordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coordinator.swift; sourceTree = ""; }; C003CC1C2AD917CF00AFFAAC /* AppCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCoordinator.swift; sourceTree = ""; }; - C003CC1E2AD917F900AFFAAC /* SplashCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashCoordinator.swift; sourceTree = ""; }; + C003CC1E2AD917F900AFFAAC /* SplashCoordinatorImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashCoordinatorImpl.swift; sourceTree = ""; }; C003CC202AD9181600AFFAAC /* TodayCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayCoordinator.swift; sourceTree = ""; }; - C003CC222AD9183600AFFAAC /* AuthCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthCoordinator.swift; sourceTree = ""; }; + C003CC222AD9183600AFFAAC /* AuthCoordinatorImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthCoordinatorImpl.swift; sourceTree = ""; }; C003CC242AD9184700AFFAAC /* TabbbarCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabbbarCoordinator.swift; sourceTree = ""; }; - C003CC262AD9185A00AFFAAC /* ArticleCategoryCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleCategoryCoordinator.swift; sourceTree = ""; }; + C003CC262AD9185A00AFFAAC /* ArticleCategoryCoordinatorImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleCategoryCoordinatorImpl.swift; sourceTree = ""; }; C003CC282AD9186B00AFFAAC /* CurriculumCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurriculumCoordinator.swift; sourceTree = ""; }; C003CC2A2AD9187B00AFFAAC /* ChallengeCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChallengeCoordinator.swift; sourceTree = ""; }; C003CC2C2AD9189100AFFAAC /* BookmarkCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarkCoordinator.swift; sourceTree = ""; }; @@ -471,6 +478,13 @@ C009E9F92ADBC4DE00112F18 /* BookmarkViewControllerable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarkViewControllerable.swift; sourceTree = ""; }; C009E9FB2ADBC4FD00112F18 /* ChallengeViewControllerable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChallengeViewControllerable.swift; sourceTree = ""; }; C009E9FD2ADBC51400112F18 /* ArticleCategoryViewControllerable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleCategoryViewControllerable.swift; sourceTree = ""; }; + C034EDD52ADE21BD00AD6FF3 /* SplashCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashCoordinator.swift; sourceTree = ""; }; + C034EDD72ADE21D200AD6FF3 /* SplashAdaptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashAdaptor.swift; sourceTree = ""; }; + C034EDD92ADE2A0E00AD6FF3 /* AuthCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthCoordinator.swift; sourceTree = ""; }; + C034EDDB2ADE2A2C00AD6FF3 /* AuthAdaptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthAdaptor.swift; sourceTree = ""; }; + C034EDDD2ADE2F3500AD6FF3 /* ArticleListByCategoryViewControllerable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleListByCategoryViewControllerable.swift; sourceTree = ""; }; + C034EE1D2ADE44E200AD6FF3 /* ArticleCategoryAdaptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleCategoryAdaptor.swift; sourceTree = ""; }; + C034EE1F2ADE450600AD6FF3 /* ArticleCategoryCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleCategoryCoordinator.swift; sourceTree = ""; }; C04BE3AC2ADD4F5D001967B5 /* TodayCoordinatorImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayCoordinatorImpl.swift; sourceTree = ""; }; C04BE3AE2ADD4F7F001967B5 /* TodayAdaptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayAdaptor.swift; sourceTree = ""; }; C065F0022ADBD2270094912C /* AuthFactoryImpl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthFactoryImpl.swift; sourceTree = ""; }; @@ -1284,6 +1298,7 @@ C065F00C2ADBD29A0094912C /* OnboardingViewControllerable.swift */, C065F00E2ADBD2AD0094912C /* CompleteOnbardingViewControllerable.swift */, C065F0102ADBD2C40094912C /* SplashViewControllerable.swift */, + C034EDDD2ADE2F3500AD6FF3 /* ArticleListByCategoryViewControllerable.swift */, ); path = ControllerableInterface; sourceTree = ""; @@ -1444,6 +1459,9 @@ B53F4EED2ADE245B001C5752 /* CurriculumAdaptor.swift */, B53F4EF52ADE2DEB001C5752 /* ChallengeAdaptor.swift */, B53F4EF92ADE3151001C5752 /* BookmarkAdaptor.swift */, + C034EDD72ADE21D200AD6FF3 /* SplashAdaptor.swift */, + C034EDDB2ADE2A2C00AD6FF3 /* AuthAdaptor.swift */, + C034EE1D2ADE44E200AD6FF3 /* ArticleCategoryAdaptor.swift */, ); path = Adaptor; sourceTree = ""; @@ -1452,16 +1470,16 @@ isa = PBXGroup; children = ( C003CC1C2AD917CF00AFFAAC /* AppCoordinator.swift */, - C003CC1E2AD917F900AFFAAC /* SplashCoordinator.swift */, C003CC202AD9181600AFFAAC /* TodayCoordinator.swift */, - C003CC222AD9183600AFFAAC /* AuthCoordinator.swift */, C003CC242AD9184700AFFAAC /* TabbbarCoordinator.swift */, - C003CC262AD9185A00AFFAAC /* ArticleCategoryCoordinator.swift */, C003CC282AD9186B00AFFAAC /* CurriculumCoordinator.swift */, C003CC2A2AD9187B00AFFAAC /* ChallengeCoordinator.swift */, C003CC2C2AD9189100AFFAAC /* BookmarkCoordinator.swift */, C003CC2E2AD9189F00AFFAAC /* MypageCoordinator.swift */, C003CC302AD918AB00AFFAAC /* ArticleCoordinator.swift */, + C034EDD52ADE21BD00AD6FF3 /* SplashCoordinator.swift */, + C034EDD92ADE2A0E00AD6FF3 /* AuthCoordinator.swift */, + C034EE1F2ADE450600AD6FF3 /* ArticleCategoryCoordinator.swift */, ); path = CoordinatorInterface; sourceTree = ""; @@ -1469,10 +1487,13 @@ C04BE3AB2ADD4F34001967B5 /* CoordinatorImpl */ = { isa = PBXGroup; children = ( + C003CC222AD9183600AFFAAC /* AuthCoordinatorImpl.swift */, C04BE3AC2ADD4F5D001967B5 /* TodayCoordinatorImpl.swift */, B53F4EF12ADE2687001C5752 /* CurriculumCoordinatorImpl.swift */, B53F4EF72ADE2FB0001C5752 /* ChallengeCoordinatorImpl.swift */, B53F4EFB2ADE3341001C5752 /* BookmarkCoordinatorImpl.swift */, + C003CC1E2AD917F900AFFAAC /* SplashCoordinatorImpl.swift */, + C003CC262AD9185A00AFFAAC /* ArticleCategoryCoordinatorImpl.swift */, ); path = CoordinatorImpl; sourceTree = ""; @@ -1893,6 +1914,7 @@ C0DF034F2A5A9B9C0037F740 /* MyPageViewController.swift in Sources */, C0DF03A92A5CF0460037F740 /* UserOnboardingModel.swift in Sources */, C0B15E212AC0450E0058D56B /* ArticleListTableView.swift in Sources */, + C034EDDA2ADE2A0E00AD6FF3 /* AuthCoordinator.swift in Sources */, C065F0092ADBD2640094912C /* TodayViewControllerable.swift in Sources */, B5C6A2B42A5DB11A0021BE5E /* ThumnailTableViewCell.swift in Sources */, B59BFD412ADBBFB2005D2D81 /* MyPageFactory.swift in Sources */, @@ -1920,7 +1942,7 @@ B57BEB6E2A6275D600D1727C /* Serviceable.swift in Sources */, D342807A2A67F12200DA1499 /* ChallengeDataResponse.swift in Sources */, B57BEB652A6134B800D1727C /* setRootViewController.swift in Sources */, - C003CC232AD9183600AFFAAC /* AuthCoordinator.swift in Sources */, + C003CC232AD9183600AFFAAC /* AuthCoordinatorImpl.swift in Sources */, C0856B892ABFDA240026D9F8 /* Badge.swift in Sources */, B5C6A2C22A5DEA1B0021BE5E /* CopyRightTableViewCell.swift in Sources */, C0856B7B2ABFC9640026D9F8 /* SplashManagerImpl.swift in Sources */, @@ -1944,10 +1966,11 @@ F4DB30BC2A61691F00413EB9 /* CurriculumArticleByWeekRowZeroTableViewCell.swift in Sources */, C009E9FC2ADBC4FD00112F18 /* ChallengeViewControllerable.swift in Sources */, C0DF039A2A5B908E0037F740 /* CGColor+.swift in Sources */, + C034EE1E2ADE44E200AD6FF3 /* ArticleCategoryAdaptor.swift in Sources */, C003CC662ADA518E00AFFAAC /* ArticleDetailManager.swift in Sources */, B53F4EF62ADE2DEB001C5752 /* ChallengeAdaptor.swift in Sources */, 4AD216402A69AC1E00C9F2F2 /* MyPageResponse.swift in Sources */, - C003CC1F2AD917F900AFFAAC /* SplashCoordinator.swift in Sources */, + C003CC1F2AD917F900AFFAAC /* SplashCoordinatorImpl.swift in Sources */, C003CC6E2ADA51E200AFFAAC /* CurriculumListManager.swift in Sources */, B53F4EFA2ADE3151001C5752 /* BookmarkAdaptor.swift in Sources */, D35272D12A681E13002D7FCB /* ChallengeData.swift in Sources */, @@ -1974,6 +1997,7 @@ C0DF03352A5A93530037F740 /* UIControl+.swift in Sources */, C003CC592ADA4FFF00AFFAAC /* TokenState.swift in Sources */, C0F029E22A5FAE2700E0D185 /* LHOnboardingErrorLabel.swift in Sources */, + C034EDDC2ADE2A2C00AD6FF3 /* AuthAdaptor.swift in Sources */, B57BEB702A6275F500D1727C /* ViewControllerServiceable.swift in Sources */, C0DF032F2A5A92170037F740 /* NameSpace.swift in Sources */, B53F4EFC2ADE3341001C5752 /* BookmarkCoordinatorImpl.swift in Sources */, @@ -1999,7 +2023,7 @@ C0856B6B2ABFBC9D0026D9F8 /* ArticleDetailManagerImpl.swift in Sources */, C0B15E272AC104D50058D56B /* LHImageButton.swift in Sources */, B5C6A2B62A5DD5FE0021BE5E /* TitleTableViewCell.swift in Sources */, - C003CC272AD9185A00AFFAAC /* ArticleCategoryCoordinator.swift in Sources */, + C003CC272AD9185A00AFFAAC /* ArticleCategoryCoordinatorImpl.swift in Sources */, C0DF03962A5B8FB10037F740 /* Palette.swift in Sources */, C003CC682ADA51A700AFFAAC /* ArticleListByCategoryManager.swift in Sources */, C003CC6A2ADA51C000AFFAAC /* MyPageManager.swift in Sources */, @@ -2027,6 +2051,7 @@ C003CC3F2ADA4EC300AFFAAC /* CurriculumNavigation.swift in Sources */, C009E9FA2ADBC4DE00112F18 /* BookmarkViewControllerable.swift in Sources */, F435E04C2A5DA6A40098E691 /* CurriculumUserInfoView.swift in Sources */, + C034EDDE2ADE2F3500AD6FF3 /* ArticleListByCategoryViewControllerable.swift in Sources */, C003CC452ADA4F1E00AFFAAC /* ArticleListByCategoryNavigation.swift in Sources */, 4A8980C72A6146DA00746C58 /* MyPageCustomerServiceCollectionViewCell.swift in Sources */, C0856B752ABFC4CB0026D9F8 /* MyPageManagerImpl.swift in Sources */, @@ -2065,6 +2090,7 @@ C065F0072ADBD24B0094912C /* TodayFactoryImpl.swift in Sources */, C0DF034D2A5A9B8D0037F740 /* (null) in Sources */, 4A52DD9B2ADBBF2C00858230 /* SpalshFactory.swift in Sources */, + C034EDD82ADE21D200AD6FF3 /* SplashAdaptor.swift in Sources */, 4A81C2912ACC7DC80056E815 /* UICollectionViewCell+.swift in Sources */, C003CC2D2AD9189100AFFAAC /* BookmarkCoordinator.swift in Sources */, C0856B772ABFC4EA0026D9F8 /* MyPageServiceImpl.swift in Sources */, @@ -2092,6 +2118,7 @@ C0DF03592A5A9BF80037F740 /* ArticleCategoryViewController.swift in Sources */, C00780BA2A60149D0043EB36 /* LHTodayArticleTitle.swift in Sources */, B51220602A60111C006CBE2D /* Token.swift in Sources */, + C034EDD62ADE21BD00AD6FF3 /* SplashCoordinator.swift in Sources */, B53F4EE32ADBC1A3001C5752 /* ArticleFactoryImpl.swift in Sources */, C003CC702ADA51F300AFFAAC /* ChallengeManager.swift in Sources */, C009E9EE2ADBC07700112F18 /* ArticleCategortFactoryImpl.swift in Sources */, @@ -2116,6 +2143,7 @@ D3AB54C12A62CE3F0017BF53 /* ChallengeDayCheckCollectionViewCollectionViewCell.swift in Sources */, B5C6A2B22A5DB0B10021BE5E /* ArticleDetailTableView.swift in Sources */, C003CC4F2ADA4F8D00AFFAAC /* OnboardingNavigation.swift in Sources */, + C034EE202ADE450600AD6FF3 /* ArticleCategoryCoordinator.swift in Sources */, B59892E12A5AF39300CE1FEB /* LHNavigationBarView.swift in Sources */, C0F029E62A5FB9E000E0D185 /* ContainerView.swift in Sources */, C0856B712ABFC0FB0026D9F8 /* ChallengeManagerImpl.swift in Sources */, @@ -2131,7 +2159,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B532E8492A5525C800F0DB19 /* LionHeart_iOSTests.swift in Sources */, + C034EDE02ADE3A4A00AD6FF3 /* LionHeart_iOSTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/ArticleCategoryAdaptor.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/ArticleCategoryAdaptor.swift new file mode 100644 index 00000000..eaba6d0b --- /dev/null +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/ArticleCategoryAdaptor.swift @@ -0,0 +1,42 @@ +// +// ArticleCategoryAdaptor.swift +// LionHeart-iOS +// +// Created by uiskim on 2023/10/17. +// + +import Foundation + +typealias EntireArticleCategoryNavigation = ArticleCategoryNavigation & ArticleListByCategoryNavigation + +final class ArticleCategoryAdaptor: EntireArticleCategoryNavigation { + + let coordinator: ArticleCategoryCoordinator + init(coordinator: ArticleCategoryCoordinator) { + self.coordinator = coordinator + } + + func articleListCellTapped(categoryName: String) { + self.coordinator.showArticleListbyCategoryViewController(categoryName: categoryName) + } + + func articleListByCategoryCellTapped(articleID: Int) { + self.coordinator.showArticleDetailViewController(articleID: articleID) + } + + func checkTokenIsExpired() { + self.coordinator.exitApplication() + } + + func navigationRightButtonTapped() { + self.coordinator.showMypageViewController() + } + + func navigationLeftButtonTapped() { + self.coordinator.showBookmarkViewController() + } + + func backButtonTapped() { + self.coordinator.pop() + } +} diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/AuthAdaptor.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/AuthAdaptor.swift new file mode 100644 index 00000000..3183ee28 --- /dev/null +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/AuthAdaptor.swift @@ -0,0 +1,38 @@ +// +// AuthAdaptor.swift +// LionHeart-iOS +// +// Created by uiskim on 2023/10/17. +// + +import Foundation + +typealias EntireAuthNaviation = LoginNavigation & OnboardingNavigation & CompleteOnbardingNavigation + +final class AuthAdaptor: EntireAuthNaviation { + + let coordinator: AuthCoordinator + init(coordinator: AuthCoordinator) { + self.coordinator = coordinator + } + + func checkUserIsVerified(userState: UserState, kakaoToken: String?) { + self.coordinator.showTabbarOrOnboardingViewController(userState: userState, kakaoToken: kakaoToken) + } + + func onboardingCompleted(data: UserOnboardingModel) { + self.coordinator.showOnboardingCompleteViewController(data: data) + } + + func startButtonTapped() { + self.coordinator.showTabbarController() + } + + func checkTokenIsExpired() { + self.coordinator.exitApplication() + } + + func backButtonTapped() { + self.coordinator.pop() + } +} diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift new file mode 100644 index 00000000..0daa845d --- /dev/null +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift @@ -0,0 +1,27 @@ +// +// SplashAdaptor.swift +// LionHeart-iOS +// +// Created by uiskim on 2023/10/17. +// + +import Foundation + +typealias EntireSplashNavigation = SplashNavigation + +final class SplashAdaptor: EntireSplashNavigation { + + let coordinator: SplashCoordinator + init(coordinator: SplashCoordinator) { + self.coordinator = coordinator + } + + func checkToken(state: TokenState) { + switch state { + case .valid: + coordinator.showTabbarViewContoller() + case .expired: + coordinator.showLoginViewController() + } + } +} diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/TodayAdaptor.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/TodayAdaptor.swift index 001413d8..b665e5ea 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/TodayAdaptor.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/TodayAdaptor.swift @@ -5,9 +5,11 @@ // Created by uiskim on 2023/10/16. // -import UIKit +import Foundation -final class TodayAdaptor: TodayNavigation { +typealias EntireTodayNavigation = TodayNavigation + +final class TodayAdaptor: EntireTodayNavigation { let coordinator: TodayCoordinator init(coordinator: TodayCoordinator) { diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleCategory/ViewControllers/ArticleCategoryViewController.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleCategory/ViewControllers/ArticleCategoryViewController.swift index 1bb57677..2cad7d4b 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleCategory/ViewControllers/ArticleCategoryViewController.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleCategory/ViewControllers/ArticleCategoryViewController.swift @@ -12,7 +12,7 @@ import SnapKit final class ArticleCategoryViewController: UIViewController, ArticleCategoryViewControllerable { - weak var coordinator: ArticleCategoryNavigation? + var navigator: ArticleCategoryNavigation private lazy var navigationBar = LHNavigationBarView(type: .explore, viewController: self) private lazy var titleLabel = LHLabel(type: .head2, color: .white, lines: 2, basicText: "카테고리별\n아티클 모아보기") @@ -31,6 +31,15 @@ final class ArticleCategoryViewController: UIViewController, ArticleCategoryView setDelegate() setCollectionView() } + + init(navigator: ArticleCategoryNavigation) { + self.navigator = navigator + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } } private extension ArticleCategoryViewController { @@ -69,11 +78,11 @@ private extension ArticleCategoryViewController { func setAddTarget() { navigationBar.rightFirstBarItemAction { - self.coordinator?.navigationLeftButtonTapped() + self.navigator.navigationLeftButtonTapped() } navigationBar.rightSecondBarItemAction { - self.coordinator?.navigationRightButtonTapped() + self.navigator.navigationRightButtonTapped() } } @@ -108,7 +117,7 @@ extension ArticleCategoryViewController: UICollectionViewDataSource { } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - coordinator?.articleListCellTapped(categoryName: dummyCase[indexPath.item].categoryString) + navigator.articleListCellTapped(categoryName: dummyCase[indexPath.item].categoryString) } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleListByCategory/ViewControllers/ArticleListByCategoryViewController.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleListByCategory/ViewControllers/ArticleListByCategoryViewController.swift index 65b71eec..137669e9 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleListByCategory/ViewControllers/ArticleListByCategoryViewController.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Article/ArticleListByCategory/ViewControllers/ArticleListByCategoryViewController.swift @@ -10,14 +10,9 @@ import UIKit import SnapKit -protocol ArticleListByCategoryViewControllerable where Self: UIViewController { - var coordinator: ArticleListByCategoryNavigation? { get set } - var categoryString: String? { get set } -} - final class ArticleListByCategoryViewController: UIViewController, ArticleListByCategoryViewControllerable { - weak var coordinator: ArticleListByCategoryNavigation? + var navigator: ArticleListByCategoryNavigation private let manager: ArticleListByCategoryManager private lazy var navigationBar = LHNavigationBarView(type: .exploreEachCategory, viewController: self) @@ -30,8 +25,9 @@ final class ArticleListByCategoryViewController: UIViewController, ArticleListBy } } - init(manager: ArticleListByCategoryManager) { + init(manager: ArticleListByCategoryManager, navigator: ArticleListByCategoryNavigation) { self.manager = manager + self.navigator = navigator super.init(nibName: nil, bundle: nil) } @@ -99,7 +95,7 @@ private extension ArticleListByCategoryViewController { func setAddTarget() { navigationBar.backButtonAction { - self.coordinator?.backButtonTapped() + self.navigator.backButtonTapped() } } } @@ -116,7 +112,7 @@ extension ArticleListByCategoryViewController: ViewControllerServiceable { case .fetchImageError: LHToast.show(message: "Image Error") case .unAuthorizedError: - coordinator?.checkTokenIsExpired() + navigator.checkTokenIsExpired() case .clientError(_, let message): LHToast.show(message: message) case .serverError: @@ -152,6 +148,6 @@ extension ArticleListByCategoryViewController: UITableViewDataSource { extension ArticleListByCategoryViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - self.coordinator?.articleListByCategoryCellTapped(articleID: articleListData[indexPath.row].articleId) + self.navigator.articleListByCategoryCellTapped(articleID: articleListData[indexPath.row].articleId) } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/ArticleCategoryViewControllerable.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/ArticleCategoryViewControllerable.swift index af08d7ce..92d9dec8 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/ArticleCategoryViewControllerable.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/ArticleCategoryViewControllerable.swift @@ -8,5 +8,5 @@ import UIKit protocol ArticleCategoryViewControllerable where Self: UIViewController { - var coordinator: ArticleCategoryNavigation? {get set} + var navigator: ArticleCategoryNavigation {get set} } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/ArticleListByCategoryViewControllerable.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/ArticleListByCategoryViewControllerable.swift new file mode 100644 index 00000000..544148be --- /dev/null +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/ArticleListByCategoryViewControllerable.swift @@ -0,0 +1,13 @@ +// +// ArticleListByCategoryViewControllerable.swift +// LionHeart-iOS +// +// Created by uiskim on 2023/10/17. +// + +import UIKit + +protocol ArticleListByCategoryViewControllerable where Self: UIViewController { + var navigator: ArticleListByCategoryNavigation { get set } + var categoryString: String? { get set } +} diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/CompleteOnbardingViewControllerable.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/CompleteOnbardingViewControllerable.swift index e5fb2fdb..fe191a12 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/CompleteOnbardingViewControllerable.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/CompleteOnbardingViewControllerable.swift @@ -8,6 +8,6 @@ import UIKit protocol CompleteOnbardingViewControllerable where Self: UIViewController { - var coordinator: CompleteOnbardingNavigation? { get set } + var navigator: CompleteOnbardingNavigation { get set } var userData: UserOnboardingModel? { get set } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/LoginViewControllerable.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/LoginViewControllerable.swift index f686c198..2dffe0c7 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/LoginViewControllerable.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/LoginViewControllerable.swift @@ -8,5 +8,5 @@ import UIKit protocol LoginViewControllerable where Self: UIViewController { - var coordinator: LoginNavigation? { get set } + var navigator: LoginNavigation { get set } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/OnboardingViewControllerable.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/OnboardingViewControllerable.swift index a4b3b2ce..27f3c121 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/OnboardingViewControllerable.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/OnboardingViewControllerable.swift @@ -8,6 +8,6 @@ import UIKit protocol OnboardingViewControllerable where Self: UIViewController { - var coordinator: OnboardingNavigation? { get set } + var navigator: OnboardingNavigation { get set } func setKakaoAccessToken(_ token: String?) } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/SplashViewControllerable.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/SplashViewControllerable.swift index ac4f28e3..05fb2b8b 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/SplashViewControllerable.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/SplashViewControllerable.swift @@ -8,5 +8,5 @@ import UIKit protocol SplashViewControllerable where Self: UIViewController { - var coordinator: SplashNavigation? { get set } + var navigator: SplashNavigation { get set } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/TodayViewControllerable.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/TodayViewControllerable.swift index 91de8a47..ea3860f8 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/TodayViewControllerable.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/ControllerableInterface/TodayViewControllerable.swift @@ -8,5 +8,5 @@ import UIKit protocol TodayViewControllerable where Self: UIViewController { - var adaptor: TodayNavigation { get set } + var navigator: TodayNavigation { get set } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/ArticleCategoryCoordinatorImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/ArticleCategoryCoordinatorImpl.swift new file mode 100644 index 00000000..b1acc0bf --- /dev/null +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/ArticleCategoryCoordinatorImpl.swift @@ -0,0 +1,78 @@ +// +// ArticleCategoryCoordinator.swift +// LionHeart-iOS +// +// Created by uiskim on 2023/10/13. +// + +import UIKit + +final class ArticleCategoryCoordinatorImpl: ArticleCategoryCoordinator { + + weak var parentCoordinator: Coordinator? + + private let factory: ArticleCategortFactory + + var children: [Coordinator] = [] + + var navigationController: UINavigationController + + init(navigationController: UINavigationController, factory: ArticleCategortFactory) { + self.navigationController = navigationController + self.factory = factory + } + + func start() { + showArticleCategoryViewController() + } + + func showArticleCategoryViewController() { + let articleCategoryAdaptor = ArticleCategoryAdaptor(coordinator: self) + let articleCategoryViewController = factory.makeArticleCategoryViewController(navigator: articleCategoryAdaptor) + self.navigationController.pushViewController(articleCategoryViewController, animated: true) + } + + func showArticleDetailViewController(articleID: Int) { + let articleCoordinator = ArticleCoordinator( + navigationController: navigationController, + factory: ArticleFactoryImpl(), + articleId: articleID + ) + articleCoordinator.parentCoordinator = self + children.append(articleCoordinator) + articleCoordinator.start() + } + + func showArticleListbyCategoryViewController(categoryName: String) { + let articleListbyCategoryViewController = factory.makeArticleListByCategoryViewController(coordinator: self) + articleListbyCategoryViewController.categoryString = categoryName + self.navigationController.pushViewController(articleListbyCategoryViewController, animated: true) + } + + func showBookmarkViewController() { + let bookmarkFactory = BookmarkFactoryImpl() + let bookmarkCoordinator = BookmarkCoordinator(navigationController: navigationController, factory: bookmarkFactory) + bookmarkCoordinator.start() + children.append(bookmarkCoordinator) + } + + func showMypageViewController() { + let mypageCoordinator = MypageCoordinator( + navigationController: navigationController, + factory: MyPageFactoryImpl() + ) + mypageCoordinator.start() + children.append(mypageCoordinator) + } + + func pop() { + self.navigationController.popViewController(animated: true) + } + + func exitApplication() { + UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + exit(0) + } + } +} diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/AuthCoordinatorImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/AuthCoordinatorImpl.swift new file mode 100644 index 00000000..bfada5d7 --- /dev/null +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/AuthCoordinatorImpl.swift @@ -0,0 +1,65 @@ +// +// AuthCoordinator.swift +// LionHeart-iOS +// +// Created by uiskim on 2023/10/13. +// + +import UIKit + +final class AuthCoordinatorImpl: AuthCoordinator { + weak var parentCoordinator: Coordinator? + private let factory: AuthFactory + + var children: [Coordinator] = [] + + var navigationController: UINavigationController + + init(navigationController: UINavigationController, factory: AuthFactory) { + self.navigationController = navigationController + self.factory = factory + } + + func start() { + showLoginViewController() + } + + func showLoginViewController() { + let loginViewController = factory.makeLoginViewController(coordinator: self) + self.navigationController.pushViewController(loginViewController, animated: true) + } + + func showTabbarController() { + let splashCoorinator = parentCoordinator as? SplashCoordinatorImpl + splashCoorinator?.showTabbarViewContoller() + } + + func showOnboardingCompleteViewController(data: UserOnboardingModel) { + let completeViewController = factory.makeCompleteOnbardingViewController(coordinator: self) + completeViewController.userData = data + self.navigationController.pushViewController(completeViewController, animated: true) + } + + func showTabbarOrOnboardingViewController(userState: UserState, kakaoToken: String?) { + let splashCoorinator = parentCoordinator as? SplashCoordinatorImpl + switch userState { + case .verified: + splashCoorinator?.showTabbarViewContoller() + case .nonVerified: + let onboardingViewController = factory.makeOnboardingViewController(coordinator: self) + onboardingViewController.setKakaoAccessToken(kakaoToken) + self.navigationController.pushViewController(onboardingViewController, animated: true) + } + } + + func pop() { + self.navigationController.popViewController(animated: true) + } + + func exitApplication() { + UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + exit(0) + } + } +} diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/SplashCoordinatorImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/SplashCoordinatorImpl.swift new file mode 100644 index 00000000..3fbc5bd3 --- /dev/null +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/SplashCoordinatorImpl.swift @@ -0,0 +1,47 @@ +// +// SplashCoordinator.swift +// LionHeart-iOS +// +// Created by uiskim on 2023/10/13. +// + +import UIKit + +final class SplashCoordinatorImpl: SplashCoordinator { + + weak var parentCoordinator: Coordinator? + private let factory: SplashFactory + + var children: [Coordinator] = [] + + var navigationController: UINavigationController + + init(navigationController: UINavigationController, factory: SplashFactory) { + self.navigationController = navigationController + self.factory = factory + } + + func start() { + showSplashViewController() + } + + func showSplashViewController() { + let splashViewController = factory.makeSplashViewController(coordinator: self) + self.navigationController.pushViewController(splashViewController, animated: false) + } + + func showTabbarViewContoller() { + let tabbarCoordinator = TabbarCoordinator(navigationController: navigationController) + children.removeAll() + tabbarCoordinator.parentCoordinator = self + tabbarCoordinator.start() + } + + func showLoginViewController() { + let authCoordinator = AuthCoordinatorImpl(navigationController: navigationController, factory: AuthFactoryImpl()) + children.removeAll() + authCoordinator.parentCoordinator = self + children.append(authCoordinator) + authCoordinator.start() + } +} diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/TodayCoordinatorImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/TodayCoordinatorImpl.swift index 095ca5e9..24510c3b 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/TodayCoordinatorImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/TodayCoordinatorImpl.swift @@ -25,9 +25,8 @@ final class TodayCoordinatorImpl: TodayCoordinator { } func showTodayViewController() { - let todayAdaptor = TodayAdaptor(coordinator: self) - let todayVC = factory.makeTodayViewController(adaptor: todayAdaptor) - self.navigationController.pushViewController(todayVC, animated: true) + let todayViweController = factory.makeTodayViewController(coordinator: self) + self.navigationController.pushViewController(todayViweController, animated: true) } func showArticleDetaileViewController(articleID: Int) { diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AppCoordinator.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AppCoordinator.swift index 965bf292..291d7010 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AppCoordinator.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AppCoordinator.swift @@ -23,7 +23,7 @@ final class AppCoordinator: Coordinator { } func startSplashCoordinator() { - let splashCoordinator = SplashCoordinator(navigationController: navigationController, factory: SplashFactoryImpl()) + let splashCoordinator = SplashCoordinatorImpl(navigationController: navigationController, factory: SplashFactoryImpl()) children.removeAll() splashCoordinator.parentCoordinator = self children.append(splashCoordinator) diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/ArticleCategoryCoordinator.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/ArticleCategoryCoordinator.swift index 05e5ec10..0c81d8a3 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/ArticleCategoryCoordinator.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/ArticleCategoryCoordinator.swift @@ -2,79 +2,17 @@ // ArticleCategoryCoordinator.swift // LionHeart-iOS // -// Created by uiskim on 2023/10/13. +// Created by uiskim on 2023/10/17. // -import UIKit +import Foundation -final class ArticleCategoryCoordinator: Coordinator { - weak var parentCoordinator: Coordinator? - - private let factory: ArticleCategortFactory - - var children: [Coordinator] = [] - - var navigationController: UINavigationController - - init(navigationController: UINavigationController, factory: ArticleCategortFactory) { - self.navigationController = navigationController - self.factory = factory - } - - func start() { - showArticleCategoryViewController() - } - - func showArticleCategoryViewController() { - let articleCategoryViewController = factory.makeArticleCategoryViewController() - articleCategoryViewController.coordinator = self - self.navigationController.pushViewController(articleCategoryViewController, animated: true) - } -} - -extension ArticleCategoryCoordinator: ArticleCategoryNavigation, ArticleListByCategoryNavigation { - func checkTokenIsExpired() { - UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) - DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { - exit(0) - } - } - - func articleListByCategoryCellTapped(articleID: Int) { - let articleCoordinator = ArticleCoordinator( - navigationController: navigationController, - factory: ArticleFactoryImpl(), - articleId: articleID - ) - articleCoordinator.parentCoordinator = self - children.append(articleCoordinator) - articleCoordinator.start() - } - - func backButtonTapped() { - self.navigationController.popViewController(animated: true) - } - - func articleListCellTapped(categoryName: String) { - let articleListbyCategoryViewController = factory.makeArticleListByCategoryViewController() - articleListbyCategoryViewController.categoryString = categoryName - articleListbyCategoryViewController.coordinator = self - self.navigationController.pushViewController(articleListbyCategoryViewController, animated: true) - } - - func navigationRightButtonTapped() { - let mypageCoordinator = MypageCoordinator( - navigationController: navigationController, - factory: MyPageFactoryImpl() - ) - mypageCoordinator.start() - children.append(mypageCoordinator) - } - - func navigationLeftButtonTapped() { - let bookmarkFactory = BookmarkFactoryImpl() - let bookmarkCoordinator = BookmarkCoordinatorImpl(navigationController: navigationController, factory: bookmarkFactory) - bookmarkCoordinator.start() - children.append(bookmarkCoordinator) - } +protocol ArticleCategoryCoordinator: Coordinator { + func showArticleCategoryViewController() + func exitApplication() + func showArticleDetailViewController(articleID: Int) + func showArticleListbyCategoryViewController(categoryName: String) + func showBookmarkViewController() + func showMypageViewController() + func pop() } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AuthCoordinator.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AuthCoordinator.swift index 08157280..7f791f12 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AuthCoordinator.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/AuthCoordinator.swift @@ -2,69 +2,16 @@ // AuthCoordinator.swift // LionHeart-iOS // -// Created by uiskim on 2023/10/13. +// Created by uiskim on 2023/10/17. // -import UIKit +import Foundation -final class AuthCoordinator: Coordinator { - weak var parentCoordinator: Coordinator? - private let factory: AuthFactory - - var children: [Coordinator] = [] - - var navigationController: UINavigationController - - init(navigationController: UINavigationController, factory: AuthFactory) { - self.navigationController = navigationController - self.factory = factory - } - - func start() { - showLogin() - } - - func showLogin() { - let loginViewController = factory.makeLoginViewController() - loginViewController.coordinator = self - self.navigationController.pushViewController(loginViewController, animated: true) - } -} - -extension AuthCoordinator: LoginNavigation, OnboardingNavigation, CompleteOnbardingNavigation { - func checkTokenIsExpired() { - UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) - DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { - exit(0) - } - } - - func startButtonTapped() { - let splashCoorinator = parentCoordinator as? SplashCoordinator - splashCoorinator?.showTabbar() - } - - func onboardingCompleted(data: UserOnboardingModel) { - let completeViewController = factory.makeCompleteOnbardingViewController() - completeViewController.coordinator = self - completeViewController.userData = data - self.navigationController.pushViewController(completeViewController, animated: true) - } - - func backButtonTapped() { - self.navigationController.popViewController(animated: true) - } - - func checkUserIsVerified(userState: UserState, kakaoToken: String?) { - let splashCoorinator = parentCoordinator as? SplashCoordinator - switch userState { - case .verified: - splashCoorinator?.showTabbar() - case .nonVerified: - let onboardingViewController = factory.makeOnboardingViewController() - onboardingViewController.setKakaoAccessToken(kakaoToken) - onboardingViewController.coordinator = self - self.navigationController.pushViewController(onboardingViewController, animated: true) - } - } +protocol AuthCoordinator: Coordinator { + func showLoginViewController() + func showTabbarController() + func showOnboardingCompleteViewController(data: UserOnboardingModel) + func showTabbarOrOnboardingViewController(userState: UserState, kakaoToken: String?) + func pop() + func exitApplication() } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/MypageCoordinator.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/MypageCoordinator.swift index 74a2398f..185b5fd9 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/MypageCoordinator.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/MypageCoordinator.swift @@ -30,6 +30,13 @@ final class MypageCoordinator: Coordinator { myPageViewController.coordinator = self self.navigationController.pushViewController(myPageViewController, animated: true) } + func dismiss() { + + } + + func pop() { + + } } extension MypageCoordinator: MyPageNavigation { diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/SplashCoordinator.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/SplashCoordinator.swift index c704275a..620b127e 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/SplashCoordinator.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/SplashCoordinator.swift @@ -2,58 +2,13 @@ // SplashCoordinator.swift // LionHeart-iOS // -// Created by uiskim on 2023/10/13. +// Created by uiskim on 2023/10/17. // -import UIKit +import Foundation -final class SplashCoordinator: Coordinator { - - weak var parentCoordinator: Coordinator? - private let factory: SplashFactory - - var children: [Coordinator] = [] - - var navigationController: UINavigationController - - init(navigationController: UINavigationController, factory: SplashFactory) { - self.navigationController = navigationController - self.factory = factory - } - - func start() { - showSplashViewController() - } - - func showSplashViewController() { - let splashViewController = factory.makeSplashViewController() - splashViewController.coordinator = self - self.navigationController.pushViewController(splashViewController, animated: false) - } - - func showTabbar() { - let tabbarCoordinator = TabbarCoordinator(navigationController: navigationController) - children.removeAll() - tabbarCoordinator.parentCoordinator = self - tabbarCoordinator.start() - } - - func showLogin() { - let authCoordinator = AuthCoordinator(navigationController: navigationController, factory: AuthFactoryImpl()) - children.removeAll() - authCoordinator.parentCoordinator = self - children.append(authCoordinator) - authCoordinator.start() - } -} - -extension SplashCoordinator: SplashNavigation { - func checkToken(state: TokenState) { - switch state { - case .valid: - showTabbar() - case .expired: - showLogin() - } - } +protocol SplashCoordinator: Coordinator { + func showSplashViewController() + func showTabbarViewContoller() + func showLoginViewController() } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/TabbbarCoordinator.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/TabbbarCoordinator.swift index 00b2c761..5990e0f9 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/TabbbarCoordinator.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorInterface/TabbbarCoordinator.swift @@ -19,10 +19,10 @@ final class TabbarCoordinator: Coordinator { } func start() { - showTabbar() + showTabbarController() } - func showTabbar() { + func showTabbarController() { let tabbarController = TabBarViewController() let todayNavigationController = UINavigationController() @@ -31,7 +31,7 @@ final class TabbarCoordinator: Coordinator { todayNavigationController.tabBarItem = UITabBarItem(title: "투데이", image: .assetImage(.home), tag: 0) let articleCategoryNavigationController = UINavigationController() - let articleCategoryCoordinator = ArticleCategoryCoordinator(navigationController: articleCategoryNavigationController, factory: ArticleCategortFactoryImpl()) + let articleCategoryCoordinator = ArticleCategoryCoordinatorImpl(navigationController: articleCategoryNavigationController, factory: ArticleCategortFactoryImpl()) articleCategoryCoordinator.parentCoordinator = parentCoordinator articleCategoryNavigationController.tabBarItem = UITabBarItem(title: "탐색", image: .assetImage(.search), tag: 1) @@ -60,7 +60,4 @@ final class TabbarCoordinator: Coordinator { curriculumCoordinator.start() challengeCoordinator.start() } - - - } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ArticleCategortFactoryImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ArticleCategortFactoryImpl.swift index 4ca9211a..6990f49a 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ArticleCategortFactoryImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ArticleCategortFactoryImpl.swift @@ -8,12 +8,15 @@ import Foundation struct ArticleCategortFactoryImpl: ArticleCategortFactory { - func makeArticleCategoryViewController() -> ArticleCategoryViewControllerable { - return ArticleCategoryViewController() + func makeArticleCategoryAdaptor(coordinator: ArticleCategoryCoordinator) -> EntireArticleCategoryNavigation { + return ArticleCategoryAdaptor(coordinator: coordinator) } - func makeArticleListByCategoryViewController() -> ArticleListByCategoryViewControllerable { - let articleListbyCategoryViewController = ArticleListByCategoryViewController(manager: ArticleListByCategoryMangerImpl(articleService: ArticleServiceImpl(apiService: APIService()), bookmarkService: BookmarkServiceImpl(apiService: APIService()))) - return articleListbyCategoryViewController + func makeArticleListByCategoryViewController(coordinator: ArticleCategoryCoordinator) -> ArticleListByCategoryViewControllerable { + return ArticleListByCategoryViewController(manager: ArticleListByCategoryMangerImpl(articleService: ArticleServiceImpl(apiService: APIService()), bookmarkService: BookmarkServiceImpl(apiService: APIService())), navigator: self.makeArticleCategoryAdaptor(coordinator: coordinator)) + } + + func makeArticleCategoryViewController(navigator: ArticleCategoryNavigation) -> ArticleCategoryViewControllerable { + return ArticleCategoryViewController(navigator: navigator) } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/AuthFactoryImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/AuthFactoryImpl.swift index 4e0eadf2..82e2eac3 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/AuthFactoryImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/AuthFactoryImpl.swift @@ -8,18 +8,24 @@ import UIKit struct AuthFactoryImpl: AuthFactory { - func makeLoginViewController() -> LoginViewControllerable { - let loginViewController = LoginViewController(manager: LoginMangerImpl(authService: AuthServiceImpl(apiService: APIService()))) + func makeAuthAdaptor(coordinator: AuthCoordinator) -> EntireAuthNaviation { + return AuthAdaptor(coordinator: coordinator) + } + + func makeLoginViewController(coordinator: AuthCoordinator) -> LoginViewControllerable { + let loginViewController = LoginViewController(manager: LoginMangerImpl(authService: AuthServiceImpl(apiService: APIService())), navigator: self.makeAuthAdaptor(coordinator: coordinator)) return loginViewController } - func makeCompleteOnbardingViewController() -> CompleteOnbardingViewControllerable { - let completeViewController = CompleteOnbardingViewController() + func makeCompleteOnbardingViewController(coordinator: AuthCoordinator) -> CompleteOnbardingViewControllerable { + let completeViewController = CompleteOnbardingViewController(navigator: self.makeAuthAdaptor(coordinator: coordinator)) return completeViewController } - func makeOnboardingViewController() -> OnboardingViewControllerable { - let onboardingViewController = OnboardingViewController(manager: OnboardingManagerImpl(authService: AuthServiceImpl(apiService: APIService()))) + func makeOnboardingViewController(coordinator: AuthCoordinator) -> OnboardingViewControllerable { + let onboardingViewController = OnboardingViewController(manager: OnboardingManagerImpl(authService: AuthServiceImpl(apiService: APIService())), navigator: self.makeAuthAdaptor(coordinator: coordinator)) return onboardingViewController } + + } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift index afbf5057..95aff7d3 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift @@ -8,7 +8,11 @@ import UIKit struct SplashFactoryImpl: SplashFactory { - func makeSplashViewController() -> SplashViewControllerable { - return SplashViewController(manager: SplashManagerImpl(authService: AuthServiceImpl(apiService: APIService()))) + func makeSplashAdaptor(coordinator: SplashCoordinator) -> EntireSplashNavigation { + return SplashAdaptor(coordinator: coordinator) + } + + func makeSplashViewController(coordinator: SplashCoordinator) -> SplashViewControllerable { + return SplashViewController(manager: SplashManagerImpl(authService: AuthServiceImpl(apiService: APIService())), adaptor: self.makeSplashAdaptor(coordinator: coordinator)) } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/TodayFactoryImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/TodayFactoryImpl.swift index 3bb3ceb5..0eb8e092 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/TodayFactoryImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/TodayFactoryImpl.swift @@ -8,7 +8,11 @@ import UIKit struct TodayFactoryImpl: TodayFactory { - func makeTodayViewController(adaptor: TodayNavigation) -> TodayViewControllerable { - return TodayViewController(manager: TodayManagerImpl(articleService: ArticleServiceImpl(apiService: APIService())), adaptor: adaptor) + func makeAuthAdaptor(coordinator: TodayCoordinator) -> EntireTodayNavigation { + return TodayAdaptor(coordinator: coordinator) + } + + func makeTodayViewController(coordinator: TodayCoordinator) -> TodayViewControllerable { + return TodayViewController(manager: TodayManagerImpl(articleService: ArticleServiceImpl(apiService: APIService())), adaptor: TodayAdaptor(coordinator: coordinator)) } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ArticleCategortFactory.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ArticleCategortFactory.swift index 0779d07f..6acd1c09 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ArticleCategortFactory.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ArticleCategortFactory.swift @@ -8,6 +8,7 @@ import Foundation protocol ArticleCategortFactory { - func makeArticleCategoryViewController() -> ArticleCategoryViewControllerable - func makeArticleListByCategoryViewController() -> ArticleListByCategoryViewControllerable + func makeArticleCategoryAdaptor(coordinator: ArticleCategoryCoordinator) -> EntireArticleCategoryNavigation + func makeArticleListByCategoryViewController(coordinator: ArticleCategoryCoordinator) -> ArticleListByCategoryViewControllerable + func makeArticleCategoryViewController(navigator: ArticleCategoryNavigation) -> ArticleCategoryViewControllerable } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/AuthFactory.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/AuthFactory.swift index d80c4a18..a60a8072 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/AuthFactory.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/AuthFactory.swift @@ -8,9 +8,10 @@ import Foundation protocol AuthFactory { - func makeLoginViewController() -> LoginViewControllerable - func makeCompleteOnbardingViewController() -> CompleteOnbardingViewControllerable - func makeOnboardingViewController() -> OnboardingViewControllerable + func makeAuthAdaptor(coordinator: AuthCoordinator) -> EntireAuthNaviation + func makeLoginViewController(coordinator: AuthCoordinator) -> LoginViewControllerable + func makeCompleteOnbardingViewController(coordinator: AuthCoordinator) -> CompleteOnbardingViewControllerable + func makeOnboardingViewController(coordinator: AuthCoordinator) -> OnboardingViewControllerable } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift index 8e38ad98..7f67370d 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift @@ -8,7 +8,8 @@ import UIKit protocol SplashFactory { - func makeSplashViewController() -> SplashViewControllerable + func makeSplashAdaptor(coordinator: SplashCoordinator) -> EntireSplashNavigation + func makeSplashViewController(coordinator: SplashCoordinator) -> SplashViewControllerable } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/TodayFactory.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/TodayFactory.swift index b23dafb2..fe84ca1c 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/TodayFactory.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/TodayFactory.swift @@ -8,7 +8,8 @@ import UIKit protocol TodayFactory { - func makeTodayViewController(adaptor: TodayNavigation) -> TodayViewControllerable + func makeAuthAdaptor(coordinator: TodayCoordinator) -> EntireTodayNavigation + func makeTodayViewController(coordinator: TodayCoordinator) -> TodayViewControllerable } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Login/LoginViewController.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Login/LoginViewController.swift index 7f42e1a8..ab756422 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Login/LoginViewController.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Login/LoginViewController.swift @@ -26,7 +26,7 @@ final class LoginViewController: UIViewController, LoginViewControllerable { } } - weak var coordinator: LoginNavigation? + var navigator: LoginNavigation private let manager: LoginManager @@ -42,8 +42,9 @@ final class LoginViewController: UIViewController, LoginViewControllerable { .setMarginImageWithText(for: 8) .setBackgroundColor(color: .kakao) - init(manager: LoginManager) { + init(manager: LoginManager, navigator: LoginNavigation) { self.manager = manager + self.navigator = navigator super.init(nibName: nil, bundle: nil) } @@ -73,7 +74,7 @@ extension LoginViewController: ViewControllerServiceable { print(code, message) if code == NetworkErrorCode.unfoundUserErrorCode { LHToast.show(message: "코드 잘돌아감") - self.coordinator?.checkUserIsVerified(userState: .nonVerified, kakaoToken: kakaoAccessToken) + self.navigator.checkUserIsVerified(userState: .nonVerified, kakaoToken: kakaoAccessToken) } default: LHToast.show(message: error.description) @@ -86,7 +87,7 @@ extension LoginViewController { Task { do { try await manager.login(type: .kakao, kakaoToken: kakaoToken) - self.coordinator?.checkUserIsVerified(userState: .verified, kakaoToken: kakaoToken) + self.navigator.checkUserIsVerified(userState: .verified, kakaoToken: kakaoToken) } catch { guard let error = error as? NetworkError else { LHToast.show(message: "넷웤에러 95") diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/NavigationInterface/Common/PopNavigation.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/NavigationInterface/Common/PopNavigation.swift index b2d238a3..d54f7429 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/NavigationInterface/Common/PopNavigation.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/NavigationInterface/Common/PopNavigation.swift @@ -7,6 +7,6 @@ import Foundation -protocol PopNavigation { +protocol PopNavigation: AnyObject { func backButtonTapped() } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/CompleteOnbardingViewController.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/CompleteOnbardingViewController.swift index 200b6af4..64d3dec0 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/CompleteOnbardingViewController.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/CompleteOnbardingViewController.swift @@ -23,7 +23,7 @@ final class CompleteOnbardingViewController: UIViewController, CompleteOnbarding } } - weak var coordinator: CompleteOnbardingNavigation? + var navigator: CompleteOnbardingNavigation private let titleLabel = LHOnboardingTitleLabel(nil, align: .center) private let descriptionLabel = LHOnboardingDescriptionLabel("아티클 맞춤 환경이 준비되었어요.") @@ -37,6 +37,16 @@ final class CompleteOnbardingViewController: UIViewController, CompleteOnbarding return imageView }() + init(navigator: CompleteOnbardingNavigation) { + self.navigator = navigator + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + public override func viewDidLoad() { super.viewDidLoad() setUI() @@ -81,7 +91,7 @@ private extension CompleteOnbardingViewController { func setButtonAction() { startButton.addButtonAction { sender in - self.coordinator?.startButtonTapped() + self.navigator.startButtonTapped() } } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/OnboardingViewController.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/OnboardingViewController.swift index dcc9bf07..e314c2c8 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/OnboardingViewController.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Onboarding/ViewControllers/OnboardingViewController.swift @@ -15,7 +15,7 @@ import SnapKit final class OnboardingViewController: UIViewController, OnboardingViewControllerable { typealias OnboardingViews = [UIViewController] - weak var coordinator: OnboardingNavigation? + var navigator: OnboardingNavigation private let manager: OnboardingManager private var fetalNickName: String? @@ -49,8 +49,9 @@ final class OnboardingViewController: UIViewController, OnboardingViewController } } - init(manager: OnboardingManager) { + init(manager: OnboardingManager, navigator: OnboardingNavigation) { self.manager = manager + self.navigator = navigator super.init(nibName: nil, bundle: nil) } @@ -132,7 +133,7 @@ private extension OnboardingViewController { } onboardingNavigationbar.backButtonAction { - self.coordinator?.backButtonTapped() + self.navigator.backButtonTapped() } } @@ -159,7 +160,7 @@ private extension OnboardingViewController { func presentLoginView() { self.navigationController?.popViewController(animated: true) - self.coordinator?.backButtonTapped() + self.navigator.backButtonTapped() } func presentOnboardingView(oldValue: OnbardingFlowType) { @@ -180,7 +181,7 @@ private extension OnboardingViewController { do { try await manager.signUp(type: .kakao, onboardingModel: passingData) hideLoading() - self.coordinator?.onboardingCompleted(data: passingData) + self.navigator.onboardingCompleted(data: passingData) } catch { guard let error = error as? NetworkError else { return } handleError(error) @@ -243,7 +244,7 @@ extension OnboardingViewController: ViewControllerServiceable { case .fetchImageError: LHToast.show(message: "이미지패치에러") case .unAuthorizedError: - coordinator?.checkTokenIsExpired() + navigator.checkTokenIsExpired() case .clientError(_, let message): LHToast.show(message: message) case .serverError: diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Splash/SplashViewController.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Splash/SplashViewController.swift index 8a28b100..bb5f476a 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Splash/SplashViewController.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Splash/SplashViewController.swift @@ -12,13 +12,14 @@ import SnapKit final class SplashViewController: UIViewController, SplashViewControllerable { - weak var coordinator: SplashNavigation? + var navigator: SplashNavigation private let manager: SplashManager private let lottieImageView = LHLottie(name: "motion_logo_final") - init(manager: SplashManager) { + init(manager: SplashManager, adaptor: SplashNavigation) { self.manager = manager + self.navigator = adaptor super.init(nibName: nil, bundle: nil) } @@ -36,7 +37,7 @@ final class SplashViewController: UIViewController, SplashViewControllerable { override func viewWillAppear(_ animated: Bool) { lottieImageView.play { _ in guard let accessToken = UserDefaultsManager.tokenKey?.accessToken, let refreshToken = UserDefaultsManager.tokenKey?.refreshToken else { - self.coordinator?.checkToken(state: .expired) + self.navigator.checkToken(state: .expired) return } Task { @@ -77,7 +78,7 @@ private extension SplashViewController { let dtoToken = try await manager.reissueToken(token: Token(accessToken: accessToken, refreshToken: refreshToken)) UserDefaultsManager.tokenKey?.accessToken = dtoToken?.accessToken UserDefaultsManager.tokenKey?.refreshToken = dtoToken?.refreshToken - self.coordinator?.checkToken(state: .valid) + self.navigator.checkToken(state: .valid) } catch { guard let errorModel = error as? NetworkError else { return } await handleError(errorModel) @@ -98,9 +99,9 @@ private extension SplashViewController { if code == NetworkErrorCode.unauthorizedErrorCode { guard let token = UserDefaultsManager.tokenKey else { return } await logout(token: token) - self.coordinator?.checkToken(state: .expired) + self.navigator.checkToken(state: .expired) } else if code == NetworkErrorCode.unfoundUserErrorCode { - self.coordinator?.checkToken(state: .expired) + self.navigator.checkToken(state: .expired) } default: print(error) diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Today/ViewControllers/TodayViewController.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Today/ViewControllers/TodayViewController.swift index e65df824..8ff01bb5 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Today/ViewControllers/TodayViewController.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Today/ViewControllers/TodayViewController.swift @@ -12,7 +12,7 @@ import SnapKit final class TodayViewController: UIViewController, TodayViewControllerable { - var adaptor: TodayNavigation + var navigator: TodayNavigation private let manager: TodayManager private lazy var todayNavigationBar = LHNavigationBarView(type: .today, viewController: self) @@ -25,7 +25,7 @@ final class TodayViewController: UIViewController, TodayViewControllerable { init(manager: TodayManager, adaptor: TodayNavigation) { self.manager = manager - self.adaptor = adaptor + self.navigator = adaptor super.init(nibName: nil, bundle: nil) } @@ -129,17 +129,17 @@ private extension TodayViewController { func setButtonAction() { todayNavigationBar.rightFirstBarItemAction { - self.adaptor.navigationLeftButtonTapped() + self.navigator.navigationLeftButtonTapped() } todayNavigationBar.rightSecondBarItemAction { - self.adaptor.navigationRightButtonTapped() + self.navigator.navigationRightButtonTapped() } } @objc func articleTapped(_ sender: UIButton) { guard let todayArticleID else { return } - self.adaptor.todayArticleTapped(articleID: todayArticleID) + self.navigator.todayArticleTapped(articleID: todayArticleID) } } @@ -155,7 +155,7 @@ extension TodayViewController: ViewControllerServiceable { case .fetchImageError: LHToast.show(message: "이미지패치실패", isTabBar: true) case .unAuthorizedError: - self.adaptor.checkTokenIsExpired() + self.navigator.checkTokenIsExpired() case .clientError(_, let message): LHToast.show(message: message, isTabBar: true) case .serverError: