From 080b84be29acf45248b628f869ae9e279681e1de Mon Sep 17 00:00:00 2001 From: baegteun Date: Mon, 17 Apr 2023 14:23:21 +0900 Subject: [PATCH 1/2] :pencil2: :: SIgnin -> Signin --- .../Sources/Scene/{SIgninStore.swift => SigninStore.swift} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Projects/Feature/SigninFeature/Sources/Scene/{SIgninStore.swift => SigninStore.swift} (100%) diff --git a/Projects/Feature/SigninFeature/Sources/Scene/SIgninStore.swift b/Projects/Feature/SigninFeature/Sources/Scene/SigninStore.swift similarity index 100% rename from Projects/Feature/SigninFeature/Sources/Scene/SIgninStore.swift rename to Projects/Feature/SigninFeature/Sources/Scene/SigninStore.swift From 488888fe251deac56db040b63fd8f6d5655c6ae7 Mon Sep 17 00:00:00 2001 From: baegteun Date: Mon, 17 Apr 2023 16:39:55 +0900 Subject: [PATCH 2/2] =?UTF-8?q?:zap:=20::=20Coordinator=20=ED=95=98?= =?UTF-8?q?=EB=82=98=EC=97=90=EC=84=9C=20=EA=B4=80=EB=A6=AC=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dependency+Target.swift | 4 ---- .../BaseFeature/Sources/DotoriRoutePath.swift | 16 ++++++++++++++++ .../MainFeature/Interface/MainRoutePath.swift | 5 ----- .../Sources/Moordinator/MainRouter.swift | 4 ++-- .../RootFeature/Interface/RootRoutePath.swift | 6 ------ Projects/Feature/RootFeature/Project.swift | 2 +- .../Sources/Moordinator/RootMoordinator.swift | 9 ++++++--- .../Sources/Moordinator/RootRouter.swift | 3 ++- .../Interface/SigninRoutePath.swift | 8 -------- Projects/Feature/SigninFeature/Project.swift | 1 - .../Sources/Moordinator/SigninMoordinator.swift | 5 +++-- .../Sources/Moordinator/SigninRouter.swift | 4 ++-- .../Sources/Scene/SigninStore.swift | 6 +++--- 13 files changed, 35 insertions(+), 38 deletions(-) create mode 100644 Projects/Feature/BaseFeature/Sources/DotoriRoutePath.swift delete mode 100644 Projects/Feature/MainFeature/Interface/MainRoutePath.swift delete mode 100644 Projects/Feature/RootFeature/Interface/RootRoutePath.swift delete mode 100644 Projects/Feature/SigninFeature/Interface/SigninRoutePath.swift diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift index 2084bf89..79fe71ee 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift @@ -33,10 +33,6 @@ public extension TargetDependency.Feature { target: ModulePaths.Feature.MainFeature.targetName(type: .sources), path: .relativeToFeature(ModulePaths.Feature.MainFeature.rawValue) ) - static let RootFeatureInterface = TargetDependency.project( - target: ModulePaths.Feature.RootFeature.targetName(type: .interface), - path: .relativeToFeature(ModulePaths.Feature.RootFeature.rawValue) - ) static let RootFeature = TargetDependency.project( target: ModulePaths.Feature.RootFeature.targetName(type: .sources), path: .relativeToFeature(ModulePaths.Feature.RootFeature.rawValue) diff --git a/Projects/Feature/BaseFeature/Sources/DotoriRoutePath.swift b/Projects/Feature/BaseFeature/Sources/DotoriRoutePath.swift new file mode 100644 index 00000000..f6c9bc5a --- /dev/null +++ b/Projects/Feature/BaseFeature/Sources/DotoriRoutePath.swift @@ -0,0 +1,16 @@ +import Moordinator + +public enum DotoriRoutePath: RoutePath { + case splash + case signin + case signup + case findID + case renewalPassword + case main +} + +public extension RoutePath { + var asDotori: DotoriRoutePath? { + self as? DotoriRoutePath + } +} diff --git a/Projects/Feature/MainFeature/Interface/MainRoutePath.swift b/Projects/Feature/MainFeature/Interface/MainRoutePath.swift deleted file mode 100644 index cc319976..00000000 --- a/Projects/Feature/MainFeature/Interface/MainRoutePath.swift +++ /dev/null @@ -1,5 +0,0 @@ -import Moordinator - -public enum MainRoutePath: RoutePath { - case main -} diff --git a/Projects/Feature/MainFeature/Sources/Moordinator/MainRouter.swift b/Projects/Feature/MainFeature/Sources/Moordinator/MainRouter.swift index 72054726..d61709fd 100644 --- a/Projects/Feature/MainFeature/Sources/Moordinator/MainRouter.swift +++ b/Projects/Feature/MainFeature/Sources/Moordinator/MainRouter.swift @@ -1,10 +1,10 @@ +import BaseFeature import Combine -import MainFeatureInterface import Moordinator final class MainRouter: Router { let route: PassthroughSubject = .init() var initialPath: RoutePath { - MainRoutePath.main + DotoriRoutePath.main } } diff --git a/Projects/Feature/RootFeature/Interface/RootRoutePath.swift b/Projects/Feature/RootFeature/Interface/RootRoutePath.swift deleted file mode 100644 index ed23f06f..00000000 --- a/Projects/Feature/RootFeature/Interface/RootRoutePath.swift +++ /dev/null @@ -1,6 +0,0 @@ -import Moordinator - -public enum RootRoutePath: RoutePath { - case auth - case main -} diff --git a/Projects/Feature/RootFeature/Project.swift b/Projects/Feature/RootFeature/Project.swift index c0c0a519..416fae4a 100644 --- a/Projects/Feature/RootFeature/Project.swift +++ b/Projects/Feature/RootFeature/Project.swift @@ -5,7 +5,7 @@ import DependencyPlugin let project = Project.makeModule( name: ModulePaths.Feature.RootFeature.rawValue, product: .staticLibrary, - targets: [.interface], + targets: [], internalDependencies: [ .Feature.SigninFeatureInterface, .Feature.MainFeatureInterface, diff --git a/Projects/Feature/RootFeature/Sources/Moordinator/RootMoordinator.swift b/Projects/Feature/RootFeature/Sources/Moordinator/RootMoordinator.swift index 6461b776..d47ef4a3 100644 --- a/Projects/Feature/RootFeature/Sources/Moordinator/RootMoordinator.swift +++ b/Projects/Feature/RootFeature/Sources/Moordinator/RootMoordinator.swift @@ -1,7 +1,7 @@ +import BaseFeature import Combine import MainFeatureInterface import Moordinator -import RootFeatureInterface import SigninFeatureInterface import UIKit @@ -33,9 +33,9 @@ public final class RootMoordinator: Moordinator { } public func route(to path: RoutePath) -> MoordinatorContributors { - guard let path = path as? RootRoutePath else { return .none } + guard let path = path.asDotori else { return .none } switch path { - case .auth: + case .signin: let signinMoordinator = signinFactory.makeMoordinator() Moord.use(signinMoordinator) { root in self.window.rootViewController = root @@ -62,6 +62,9 @@ public final class RootMoordinator: Moordinator { ) } return .one(.contribute(mainMoordinator)) + + default: + return .none } } } diff --git a/Projects/Feature/RootFeature/Sources/Moordinator/RootRouter.swift b/Projects/Feature/RootFeature/Sources/Moordinator/RootRouter.swift index 418f012d..c023d8b7 100644 --- a/Projects/Feature/RootFeature/Sources/Moordinator/RootRouter.swift +++ b/Projects/Feature/RootFeature/Sources/Moordinator/RootRouter.swift @@ -1,3 +1,4 @@ +import BaseFeature import Combine import Moordinator import RootFeatureInterface @@ -5,6 +6,6 @@ import RootFeatureInterface final class RootRouter: Router { let route: PassthroughSubject = .init() var initialPath: RoutePath { - RootRoutePath.auth + DotoriRoutePath.signin } } diff --git a/Projects/Feature/SigninFeature/Interface/SigninRoutePath.swift b/Projects/Feature/SigninFeature/Interface/SigninRoutePath.swift deleted file mode 100644 index 6f0e6562..00000000 --- a/Projects/Feature/SigninFeature/Interface/SigninRoutePath.swift +++ /dev/null @@ -1,8 +0,0 @@ -import Moordinator - -public enum SigninRoutePath: RoutePath { - case signin - case signup - case renewalPassword - case main -} diff --git a/Projects/Feature/SigninFeature/Project.swift b/Projects/Feature/SigninFeature/Project.swift index 055ec5cd..d895f86a 100644 --- a/Projects/Feature/SigninFeature/Project.swift +++ b/Projects/Feature/SigninFeature/Project.swift @@ -8,7 +8,6 @@ let project = Project.makeModule( targets: [.interface, .unitTest], internalDependencies: [ .Feature.BaseFeature, - .Feature.RootFeatureInterface, .Feature.SignupFeatureInterface, .Feature.RenewalPasswordFeatureInterface, .Domain.AuthDomainInterface diff --git a/Projects/Feature/SigninFeature/Sources/Moordinator/SigninMoordinator.swift b/Projects/Feature/SigninFeature/Sources/Moordinator/SigninMoordinator.swift index 61fb33f3..94ebab69 100644 --- a/Projects/Feature/SigninFeature/Sources/Moordinator/SigninMoordinator.swift +++ b/Projects/Feature/SigninFeature/Sources/Moordinator/SigninMoordinator.swift @@ -1,3 +1,4 @@ +import BaseFeature import DesignSystem import Moordinator import RenewalPasswordFeatureInterface @@ -30,7 +31,7 @@ final class SigninMoordinator: Moordinator { } func route(to path: RoutePath) -> MoordinatorContributors { - guard let path = path as? SigninRoutePath else { return .none } + guard let path = path.asDotori else { return .none } switch path { case .signin: rootVC.setViewControllers([signinViewController], animated: true) @@ -46,7 +47,7 @@ final class SigninMoordinator: Moordinator { return .one(.contribute(viewController)) case .main: - return .one(.forwardToParent(with: RootRoutePath.main)) + return .one(.forwardToParent(with: DotoriRoutePath.main)) default: return .none diff --git a/Projects/Feature/SigninFeature/Sources/Moordinator/SigninRouter.swift b/Projects/Feature/SigninFeature/Sources/Moordinator/SigninRouter.swift index 336b8f93..7c4d0b61 100644 --- a/Projects/Feature/SigninFeature/Sources/Moordinator/SigninRouter.swift +++ b/Projects/Feature/SigninFeature/Sources/Moordinator/SigninRouter.swift @@ -1,10 +1,10 @@ +import BaseFeature import Combine -import SigninFeatureInterface import Moordinator final class SigninRouter: Router { let route: PassthroughSubject = .init() var initialPath: RoutePath { - SigninRoutePath.signin + DotoriRoutePath.signin } } diff --git a/Projects/Feature/SigninFeature/Sources/Scene/SigninStore.swift b/Projects/Feature/SigninFeature/Sources/Scene/SigninStore.swift index 433eff53..88ba8e86 100644 --- a/Projects/Feature/SigninFeature/Sources/Scene/SigninStore.swift +++ b/Projects/Feature/SigninFeature/Sources/Scene/SigninStore.swift @@ -44,10 +44,10 @@ final class SigninStore: BaseStore, RouterProvidable { newState.password = password case .signupButtonDidTap: - router.route.send(SigninRoutePath.signup) + router.route.send(DotoriRoutePath.signup) case .renewalPasswordButtonDidTap: - router.route.send(SigninRoutePath.renewalPassword) + router.route.send(DotoriRoutePath.renewalPassword) case .signinButtonDidTap: signinButtonDidTap(email: newState.email, password: newState.password) @@ -64,7 +64,7 @@ final class SigninStore: BaseStore, RouterProvidable { DotoriToast.makeToast(text: err.errorDescription, style: .error) } }, receiveValue: { owner, _ in - owner.router.route.send(SigninRoutePath.main) + owner.router.route.send(DotoriRoutePath.main) }) .store(in: &bag) }