From 823e7f08294ef9d9cec80a3ce3d9da50dda1e3d6 Mon Sep 17 00:00:00 2001 From: Geonseob Kim <109283556+gnksbm@users.noreply.github.com> Date: Sat, 12 Jul 2025 21:52:59 +0900 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20Tuist=20Feature=20=ED=83=80=EC=BC=93?= =?UTF-8?q?=20Interface=EC=99=80=20Implement=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d67c7a417c802581c6bb93ed90d91ca9e2a3c84c. --- .../Target/Feature/FeatureImplement.swift | 36 +++++++++++++++++++ .../Target/Feature/FeatureInterface.swift | 32 +++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift create mode 100644 Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift diff --git a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift new file mode 100644 index 00000000..a34ea2cc --- /dev/null +++ b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift @@ -0,0 +1,36 @@ +// +// FeatureImplement.swift +// EnvironmentPlugin +// +// Created by gnksbm on 7/12/25. +// + +// TODO: Featuer 객체가 필요하지 않을 때 Feature로 네이밍 변경될 예정 +public struct FeatureImplement: ImplementTarget { + public let name: String + public let hasResource: Bool + public let dependencies: [TargetDependency] + + public let product: Product = .staticFramework + public let infoPlist: InfoPlist? + public let settings: Settings = .frameworkDebug + public let scripts: [TargetScript] + public var sources: SourceFilesList? { ["Implement/Sources/**"] } + public var resources: ResourceFileElements? { hasResource ? ["Implement/Resources/**"] : nil } + public var targetDependencyPath: Path { + .relativeToRoot("Projects/Feature/\(name)/Implement") + } + + public init( + name: String, + hasResource: Bool = false, + @TargetComponentBuilder dependencies builder: () -> TargetComponentBuilder = { .init() } + ) { + let builder = builder() + self.name = name + self.hasResource = hasResource + self.dependencies = builder.buildTargetDependency() + self.scripts = builder.buildTargetScript() + self.infoPlist = builder.buildInfoPlist() + } +} diff --git a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift new file mode 100644 index 00000000..108481dd --- /dev/null +++ b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift @@ -0,0 +1,32 @@ +// +// FeatureInterface.swift +// EnvironmentPlugin +// +// Created by gnksbm on 7/12/25. +// + +public struct FeatureInterface: BundleIDSuffixTarget, TargetDependencyBuildable { + public var projectName: String + public let dependencies: [TargetDependency] + public let infoPlist: InfoPlist? + public let scripts: [TargetScript] + + public var name: String { projectName + "Interface" } + public var product: Product { .framework } + public var sources: SourceFilesList? { ["Interface/Sources/**"] } + + public init( + name: String, + @TargetComponentBuilder dependencies builder: () -> TargetComponentBuilder = { .init() } + ) { + let builder = builder() + self.projectName = name + self.dependencies = builder.buildTargetDependency() + self.scripts = builder.buildTargetScript() + self.infoPlist = builder.buildInfoPlist() + } + + public func buildTargetDependency() -> [TargetDependency] { + [.target(name: name, status: .optional, condition: nil)] + } +} From 44fed545def255900fc1bbaeaf785e83fd6b8dc0 Mon Sep 17 00:00:00 2001 From: Geonseob Kim <109283556+gnksbm@users.noreply.github.com> Date: Sat, 12 Jul 2025 22:28:46 +0900 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20NearMapFeature=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Target/Feature/FeatureInterface.swift | 13 +++++++--- .../Sources/Coordinator/AppCoordinator.swift | 3 ++- .../Sources/DefaultCoordinatorProvider.swift | 19 +++++++++------ Projects/Feature/BusStopFeature/Project.swift | 1 + .../DafaultBusStopCoordinator.swift | 15 ++++++++---- .../DafaultNearMapCoordinator.swift | 2 +- .../BusStopClusteringKey.swift | 0 .../NMapsClustreing/LeafMarkerUpdater.swift | 0 .../Sources/View/BusStopInformationView.swift | 0 .../NearMapViewController.swift | 0 .../Sources/ViewModel/NearMapViewModel.swift | 2 +- .../Sources/NearMapCoordinator.swift | 24 +++++++++++++++++++ Projects/Feature/NearMapFeature/Project.swift | 7 +++++- Projects/Feature/SearchFeature/Project.swift | 1 + .../DafaultSearchCoordinator.swift | 13 ++++++---- .../Coordinator/CoordinatorProvider.swift | 7 ------ .../Coordinator/NearMapCoordinator.swift | 13 ---------- .../Sources/Mock/MockCoordinator.swift | 10 -------- .../Mock/MockCoordinatorProvider.swift | 12 ---------- 19 files changed, 77 insertions(+), 65 deletions(-) rename Projects/Feature/NearMapFeature/{ => Implement}/Sources/Coordinator/DafaultNearMapCoordinator.swift (98%) rename Projects/Feature/NearMapFeature/{ => Implement}/Sources/NMapsClustreing/BusStopClusteringKey.swift (100%) rename Projects/Feature/NearMapFeature/{ => Implement}/Sources/NMapsClustreing/LeafMarkerUpdater.swift (100%) rename Projects/Feature/NearMapFeature/{ => Implement}/Sources/View/BusStopInformationView.swift (100%) rename Projects/Feature/NearMapFeature/{ => Implement}/Sources/ViewController/NearMapViewController.swift (100%) rename Projects/Feature/NearMapFeature/{ => Implement}/Sources/ViewModel/NearMapViewModel.swift (99%) create mode 100644 Projects/Feature/NearMapFeature/Interface/Sources/NearMapCoordinator.swift delete mode 100644 Projects/FeatureDependency/Sources/Coordinator/NearMapCoordinator.swift diff --git a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift index 108481dd..5e31d197 100644 --- a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift +++ b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift @@ -5,7 +5,7 @@ // Created by gnksbm on 7/12/25. // -public struct FeatureInterface: BundleIDSuffixTarget, TargetDependencyBuildable { +public struct FeatureInterface: BundleIDSuffixTarget, LocalDependency { public var projectName: String public let dependencies: [TargetDependency] public let infoPlist: InfoPlist? @@ -26,7 +26,14 @@ public struct FeatureInterface: BundleIDSuffixTarget, TargetDependencyBuildable self.infoPlist = builder.buildInfoPlist() } - public func buildTargetDependency() -> [TargetDependency] { - [.target(name: name, status: .optional, condition: nil)] + public var targetDependencyPath: Path { + .relativeToRoot("Projects/Feature/\(projectName)") } + +// public func buildTargetDependency() -> [TargetDependency] { +// [ +// .pro +// .target(name: name, status: .optional, condition: nil) +// ] +// } } diff --git a/Projects/App/Sources/Coordinator/AppCoordinator.swift b/Projects/App/Sources/Coordinator/AppCoordinator.swift index fb2496bd..ecd825fd 100644 --- a/Projects/App/Sources/Coordinator/AppCoordinator.swift +++ b/Projects/App/Sources/Coordinator/AppCoordinator.swift @@ -52,7 +52,8 @@ final class AppCoordinator: Coordinator { navigationController: navigationController, busStopId: busStopId, coordinatorProvider: coordinatorProvider, - flow: .fromHome + flow: .fromHome, + nearMapCoordinatorBuilder: coordinatorProvider ) childs.append(busStopCoordinator) busStopCoordinator.start() diff --git a/Projects/App/Sources/DefaultCoordinatorProvider.swift b/Projects/App/Sources/DefaultCoordinatorProvider.swift index 95ebe22e..23a55ba9 100644 --- a/Projects/App/Sources/DefaultCoordinatorProvider.swift +++ b/Projects/App/Sources/DefaultCoordinatorProvider.swift @@ -14,6 +14,7 @@ import SearchFeature import AlarmFeature import BusStopFeature import NearMapFeature +import NearMapFeatureInterface import Domain final class DefaultCoordinatorProvider: CoordinatorProvider { @@ -39,7 +40,8 @@ final class DefaultCoordinatorProvider: CoordinatorProvider { navigationController: navigationController, busStopId: busStopId, coordinatorProvider: self, - flow: flow + flow: flow, + nearMapCoordinatorBuilder: self ) } @@ -52,6 +54,7 @@ final class DefaultCoordinatorProvider: CoordinatorProvider { parent: parent, navigationController: navigationController, coordinatorProvider: self, + nearMapCoordinatorBuilder: self, flow: flow ) } @@ -68,18 +71,20 @@ final class DefaultCoordinatorProvider: CoordinatorProvider { flow: .fromAlarm ) } - - func makeNearMapCoordinator( - parent: Coordinator, +} + +extension DefaultCoordinatorProvider: NearMapCoordinatorBuilder { + func build( + parent: any Coordinator, navigationController: UINavigationController, flow: FlowState, busStopId: String? - ) -> NearMapCoordinator { + ) -> NearMapFeatureInterface.NearMapCoordinator { DefaultNearMapCoordinator( parent: parent, - navigationController: navigationController, + navigationController: navigationController, coordinatorProvider: self, - flow: flow, + flow: flow, busStopId: busStopId ) } diff --git a/Projects/Feature/BusStopFeature/Project.swift b/Projects/Feature/BusStopFeature/Project.swift index 05731516..23ae13b0 100644 --- a/Projects/Feature/BusStopFeature/Project.swift +++ b/Projects/Feature/BusStopFeature/Project.swift @@ -6,6 +6,7 @@ let project = Project( options: .options(automaticSchemesOptions: .disabled) ) { Feature(name: "BusStopFeature") { + FeatureInterface(name: "NearMapFeature") FeatureDependency() FeatureSwiftLintScript() FrameworkInfoPlist(marketingVersion: .marketingVersion) diff --git a/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift b/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift index 5bce0a8f..aad6dbee 100644 --- a/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift +++ b/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift @@ -2,28 +2,33 @@ import UIKit import Domain import FeatureDependency +import NearMapFeatureInterface public final class DefaultBusStopCoordinator: BusStopCoordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] public var navigationController: UINavigationController - public var coordinatorProvider: CoordinatorProvider - private var busStopId: String - private let flow: FlowState public var coordinatorType: CoordinatorType = .busStop + private let coordinatorProvider: CoordinatorProvider + private let busStopId: String + private let flow: FlowState + private let nearMapCoordinatorBuilder: NearMapCoordinatorBuilder + public init( parent: Coordinator?, navigationController: UINavigationController, busStopId: String, coordinatorProvider: CoordinatorProvider, - flow: FlowState + flow: FlowState, + nearMapCoordinatorBuilder: NearMapCoordinatorBuilder ) { self.parent = parent self.navigationController = navigationController self.busStopId = busStopId self.coordinatorProvider = coordinatorProvider self.flow = flow + self.nearMapCoordinatorBuilder = nearMapCoordinatorBuilder } public func start() { @@ -45,7 +50,7 @@ public final class DefaultBusStopCoordinator: BusStopCoordinator { extension DefaultBusStopCoordinator { // 정류장 위치뷰로 이동하기 위한 public func busStopMapLocation(busStopId: String) { - let nearMapCoordinator = coordinatorProvider.makeNearMapCoordinator( + let nearMapCoordinator = nearMapCoordinatorBuilder.build( parent: self, navigationController: navigationController, flow: flow, diff --git a/Projects/Feature/NearMapFeature/Sources/Coordinator/DafaultNearMapCoordinator.swift b/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift similarity index 98% rename from Projects/Feature/NearMapFeature/Sources/Coordinator/DafaultNearMapCoordinator.swift rename to Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift index 2b363d56..14bfe09d 100644 --- a/Projects/Feature/NearMapFeature/Sources/Coordinator/DafaultNearMapCoordinator.swift +++ b/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift @@ -1,6 +1,6 @@ import UIKit -import FeatureDependency +import NearMapFeatureInterface import RxSwift diff --git a/Projects/Feature/NearMapFeature/Sources/NMapsClustreing/BusStopClusteringKey.swift b/Projects/Feature/NearMapFeature/Implement/Sources/NMapsClustreing/BusStopClusteringKey.swift similarity index 100% rename from Projects/Feature/NearMapFeature/Sources/NMapsClustreing/BusStopClusteringKey.swift rename to Projects/Feature/NearMapFeature/Implement/Sources/NMapsClustreing/BusStopClusteringKey.swift diff --git a/Projects/Feature/NearMapFeature/Sources/NMapsClustreing/LeafMarkerUpdater.swift b/Projects/Feature/NearMapFeature/Implement/Sources/NMapsClustreing/LeafMarkerUpdater.swift similarity index 100% rename from Projects/Feature/NearMapFeature/Sources/NMapsClustreing/LeafMarkerUpdater.swift rename to Projects/Feature/NearMapFeature/Implement/Sources/NMapsClustreing/LeafMarkerUpdater.swift diff --git a/Projects/Feature/NearMapFeature/Sources/View/BusStopInformationView.swift b/Projects/Feature/NearMapFeature/Implement/Sources/View/BusStopInformationView.swift similarity index 100% rename from Projects/Feature/NearMapFeature/Sources/View/BusStopInformationView.swift rename to Projects/Feature/NearMapFeature/Implement/Sources/View/BusStopInformationView.swift diff --git a/Projects/Feature/NearMapFeature/Sources/ViewController/NearMapViewController.swift b/Projects/Feature/NearMapFeature/Implement/Sources/ViewController/NearMapViewController.swift similarity index 100% rename from Projects/Feature/NearMapFeature/Sources/ViewController/NearMapViewController.swift rename to Projects/Feature/NearMapFeature/Implement/Sources/ViewController/NearMapViewController.swift diff --git a/Projects/Feature/NearMapFeature/Sources/ViewModel/NearMapViewModel.swift b/Projects/Feature/NearMapFeature/Implement/Sources/ViewModel/NearMapViewModel.swift similarity index 99% rename from Projects/Feature/NearMapFeature/Sources/ViewModel/NearMapViewModel.swift rename to Projects/Feature/NearMapFeature/Implement/Sources/ViewModel/NearMapViewModel.swift index e2db0097..4ccdbd4e 100644 --- a/Projects/Feature/NearMapFeature/Sources/ViewModel/NearMapViewModel.swift +++ b/Projects/Feature/NearMapFeature/Implement/Sources/ViewModel/NearMapViewModel.swift @@ -3,7 +3,7 @@ import UIKit import Core import DesignSystem import Domain -import FeatureDependency +import NearMapFeatureInterface import RxSwift import RxRelay diff --git a/Projects/Feature/NearMapFeature/Interface/Sources/NearMapCoordinator.swift b/Projects/Feature/NearMapFeature/Interface/Sources/NearMapCoordinator.swift new file mode 100644 index 00000000..ee82b08d --- /dev/null +++ b/Projects/Feature/NearMapFeature/Interface/Sources/NearMapCoordinator.swift @@ -0,0 +1,24 @@ +// +// NearMapCoordinator.swift +// NearMapFeature +// +// Created by gnksbm on 7/12/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +import UIKit + +@_exported import FeatureDependency + +public protocol NearMapCoordinator: Coordinator { + func startBusStopFlow(busStopId: String) +} + +public protocol NearMapCoordinatorBuilder { + func build( + parent: Coordinator, + navigationController: UINavigationController, + flow: FlowState, + busStopId: String? + ) -> NearMapCoordinator +} diff --git a/Projects/Feature/NearMapFeature/Project.swift b/Projects/Feature/NearMapFeature/Project.swift index 986a04dc..68c22bb7 100644 --- a/Projects/Feature/NearMapFeature/Project.swift +++ b/Projects/Feature/NearMapFeature/Project.swift @@ -5,10 +5,15 @@ let project = Project( name: "NearMapFeature", options: .options(automaticSchemesOptions: .disabled) ) { - Feature(name: "NearMapFeature") { + FeatureInterface(name: "NearMapFeature") { FeatureDependency() FeatureSwiftLintScript() FrameworkInfoPlist(marketingVersion: .marketingVersion) + } + FeatureImplement(name: "NearMapFeature") { + FeatureInterface(name: "NearMapFeature") + FeatureSwiftLintScript() + FrameworkInfoPlist(marketingVersion: .marketingVersion) SecretInfoPlist() } SampleApp(name: "NearMapFeature") { diff --git a/Projects/Feature/SearchFeature/Project.swift b/Projects/Feature/SearchFeature/Project.swift index 3cbaa1df..a3ef724e 100644 --- a/Projects/Feature/SearchFeature/Project.swift +++ b/Projects/Feature/SearchFeature/Project.swift @@ -6,6 +6,7 @@ let project = Project( options: .options(automaticSchemesOptions: .disabled) ) { Feature(name: "SearchFeature") { + FeatureInterface(name: "NearMapFeature") FeatureDependency() FeatureSwiftLintScript() FrameworkInfoPlist(marketingVersion: .marketingVersion) diff --git a/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift b/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift index d0e12e05..382688eb 100644 --- a/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift +++ b/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift @@ -2,24 +2,29 @@ import UIKit import Domain import FeatureDependency +import NearMapFeatureInterface public final class DefaultSearchCoordinator: SearchCoordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] public let navigationController: UINavigationController - public let coordinatorProvider: CoordinatorProvider - private let flow: FlowState public var coordinatorType: CoordinatorType = .search + private let coordinatorProvider: CoordinatorProvider + private let nearMapCoordinatorBuilder: NearMapCoordinatorBuilder + private let flow: FlowState + public init( parent: Coordinator?, navigationController: UINavigationController, coordinatorProvider: CoordinatorProvider, + nearMapCoordinatorBuilder: NearMapCoordinatorBuilder, flow: FlowState ) { self.parent = parent self.navigationController = navigationController self.coordinatorProvider = coordinatorProvider + self.nearMapCoordinatorBuilder = nearMapCoordinatorBuilder self.flow = flow } @@ -47,7 +52,7 @@ extension DefaultSearchCoordinator { } public func startNearMapFlow() { - let nearMapCoordinator = coordinatorProvider.makeNearMapCoordinator( + let nearMapCoordinator = nearMapCoordinatorBuilder.build( parent: self, navigationController: navigationController, flow: flow, @@ -58,7 +63,7 @@ extension DefaultSearchCoordinator { } public func startNearMapFlow(busStopId: String) { - let nearMapCoordinator = coordinatorProvider.makeNearMapCoordinator( + let nearMapCoordinator = nearMapCoordinatorBuilder.build( parent: self, navigationController: navigationController, flow: flow, diff --git a/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift b/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift index fd9787f9..8d6564a7 100644 --- a/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift +++ b/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift @@ -29,11 +29,4 @@ public protocol CoordinatorProvider { navigationController: UINavigationController, flow: FlowState ) -> AddRegularAlarmCoordinator - - func makeNearMapCoordinator( - parent: Coordinator, - navigationController: UINavigationController, - flow: FlowState, - busStopId: String? - ) -> NearMapCoordinator } diff --git a/Projects/FeatureDependency/Sources/Coordinator/NearMapCoordinator.swift b/Projects/FeatureDependency/Sources/Coordinator/NearMapCoordinator.swift deleted file mode 100644 index f0f67008..00000000 --- a/Projects/FeatureDependency/Sources/Coordinator/NearMapCoordinator.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// NearMapCoordinator.swift -// FeatureDependency -// -// Created by Muker on 2/2/24. -// Copyright © 2024 Pepsi-Club. All rights reserved. -// - -import Foundation - -public protocol NearMapCoordinator: Coordinator { - func startBusStopFlow(busStopId: String) -} diff --git a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift index 58e2513a..c6f6323b 100644 --- a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift +++ b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift @@ -130,14 +130,4 @@ extension MockCoordinator: AddRegularAlarmCoordinator { } } -extension MockCoordinator: NearMapCoordinator { - public func startBusStopFlow(busStopId: String) { - let coordinator = MockCoordinator( - testMessage: "BusStopFlow - busStopId: \(busStopId)", - navigationController: navigationController - ) - coordinator.start() - childs.append(coordinator) - } -} #endif diff --git a/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift b/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift index bbf746ab..f9cb6ad0 100644 --- a/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift +++ b/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift @@ -47,17 +47,5 @@ public final class MockCoordinatorProvider: CoordinatorProvider { navigationController: navigationController ) } - - public func makeNearMapCoordinator( - parent: Coordinator, - navigationController: UINavigationController, - flow: FlowState, - busStopId: String? = nil - ) -> NearMapCoordinator { - MockCoordinator( - testMessage: "NearMap - busStopId: \(busStopId ?? "nil")", - navigationController: navigationController - ) - } } #endif From c46b5129e582f1cdd54d5a9acce32971743e76d9 Mon Sep 17 00:00:00 2001 From: Geonseob Kim <109283556+gnksbm@users.noreply.github.com> Date: Sat, 19 Jul 2025 01:07:31 +0900 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20HomeFeature=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Coordinator/AppCoordinator.swift | 1 + .../Splash/SplashCoordinator.swift | 7 +++++- .../Sources/DefaultCoordinatorProvider.swift | 24 +++++++++---------- .../Coordinator/DefaultHomeCoordinator.swift | 4 ---- .../Implement/Sources/Dependencies.swift | 9 +++++++ .../Sources/View/EmptyFavoritesView.swift | 0 .../Sources/View/FavoritesHeaderView.swift | 0 .../Sources/View/FavoritesTVCell.swift | 0 .../FavoritesViewController.swift | 0 .../ViewModel/FavoritesViewModel.swift | 0 .../Interface/Sources/HomeCoordinator.swift | 23 ++++++++++++++++++ Projects/Feature/HomeFeature/Project.swift | 7 +++++- .../Sources/Coordinator/HomeCoordinator.swift | 15 ------------ .../Sources/Mock/MockCoordinator.swift | 18 +++++--------- .../Sources/TabBarCoordinator.swift | 14 ++++++----- 15 files changed, 71 insertions(+), 51 deletions(-) rename Projects/Feature/HomeFeature/{ => Implement}/Sources/Coordinator/DefaultHomeCoordinator.swift (94%) create mode 100644 Projects/Feature/HomeFeature/Implement/Sources/Dependencies.swift rename Projects/Feature/HomeFeature/{ => Implement}/Sources/View/EmptyFavoritesView.swift (100%) rename Projects/Feature/HomeFeature/{ => Implement}/Sources/View/FavoritesHeaderView.swift (100%) rename Projects/Feature/HomeFeature/{ => Implement}/Sources/View/FavoritesTVCell.swift (100%) rename Projects/Feature/HomeFeature/{ => Implement}/Sources/ViewController/FavoritesViewController.swift (100%) rename Projects/Feature/HomeFeature/{ => Implement}/Sources/ViewModel/FavoritesViewModel.swift (100%) create mode 100644 Projects/Feature/HomeFeature/Interface/Sources/HomeCoordinator.swift delete mode 100644 Projects/FeatureDependency/Sources/Coordinator/HomeCoordinator.swift diff --git a/Projects/App/Sources/Coordinator/AppCoordinator.swift b/Projects/App/Sources/Coordinator/AppCoordinator.swift index ecd825fd..4b8ca8e1 100644 --- a/Projects/App/Sources/Coordinator/AppCoordinator.swift +++ b/Projects/App/Sources/Coordinator/AppCoordinator.swift @@ -40,6 +40,7 @@ final class AppCoordinator: Coordinator { parent: self, navigationController: navigationController, coordinatorProvider: coordinatorProvider, + homeCoordinatorBuilder: coordinatorProvider, viewModelDependency: dependency ) childs.append(splashCoordinator) diff --git a/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift b/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift index a24517f6..98fb5869 100644 --- a/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift +++ b/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift @@ -10,6 +10,7 @@ import UIKit import MainFeature import FeatureDependency +import HomeFeatureInterface protocol SplashCoordinator: Coordinator { func startTabFlow() @@ -22,17 +23,20 @@ final class SplashCoordinatorImpl: SplashCoordinator { var navigationController: UINavigationController public var coordinatorType: CoordinatorType = .splash private let coordinatorProvider: CoordinatorProvider + private let homeCoordinatorBuilder: HomeCoordinatorBuilder private let viewModelDependency: SplashViewModelDependency init( parent: Coordinator, navigationController: UINavigationController, coordinatorProvider: CoordinatorProvider, + homeCoordinatorBuilder: HomeCoordinatorBuilder, viewModelDependency: SplashViewModelDependency ) { self.parent = parent self.navigationController = navigationController self.coordinatorProvider = coordinatorProvider + self.homeCoordinatorBuilder = homeCoordinatorBuilder self.viewModelDependency = viewModelDependency } @@ -46,7 +50,8 @@ final class SplashCoordinatorImpl: SplashCoordinator { func startTabFlow() { let tabBarCoordinator = TabBarCoordinator( navigationController: navigationController, - coordinatorProvider: coordinatorProvider + coordinatorProvider: coordinatorProvider, + homeCoordinatorBuilder: homeCoordinatorBuilder ) childs.append(tabBarCoordinator) tabBarCoordinator.start() diff --git a/Projects/App/Sources/DefaultCoordinatorProvider.swift b/Projects/App/Sources/DefaultCoordinatorProvider.swift index 23a55ba9..b1a050dc 100644 --- a/Projects/App/Sources/DefaultCoordinatorProvider.swift +++ b/Projects/App/Sources/DefaultCoordinatorProvider.swift @@ -15,20 +15,10 @@ import AlarmFeature import BusStopFeature import NearMapFeature import NearMapFeatureInterface +import HomeFeatureInterface import Domain final class DefaultCoordinatorProvider: CoordinatorProvider { - func makeHomeCoordinator( - parent: Coordinator, - navigationController: UINavigationController - ) -> HomeCoordinator { - DefaultHomeCoordinator( - parent: parent, - navigationController: navigationController, - coordinatorProvider: self - ) - } - func makeBusStopCoordinator( parent: Coordinator, navigationController: UINavigationController, @@ -73,13 +63,23 @@ final class DefaultCoordinatorProvider: CoordinatorProvider { } } +extension DefaultCoordinatorProvider: HomeCoordinatorBuilder { + func build(parent: any Coordinator, navigationController: UINavigationController) -> HomeCoordinator { + DefaultHomeCoordinator( + parent: parent, + navigationController: navigationController, + coordinatorProvider: self + ) + } +} + extension DefaultCoordinatorProvider: NearMapCoordinatorBuilder { func build( parent: any Coordinator, navigationController: UINavigationController, flow: FlowState, busStopId: String? - ) -> NearMapFeatureInterface.NearMapCoordinator { + ) -> NearMapCoordinator { DefaultNearMapCoordinator( parent: parent, navigationController: navigationController, diff --git a/Projects/Feature/HomeFeature/Sources/Coordinator/DefaultHomeCoordinator.swift b/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift similarity index 94% rename from Projects/Feature/HomeFeature/Sources/Coordinator/DefaultHomeCoordinator.swift rename to Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift index 148bade3..ed368c34 100644 --- a/Projects/Feature/HomeFeature/Sources/Coordinator/DefaultHomeCoordinator.swift +++ b/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift @@ -49,10 +49,6 @@ public final class DefaultHomeCoordinator { } extension DefaultHomeCoordinator: HomeCoordinator { - public func updateFavoritesState(isEmpty: Bool) { - favoritesStatus.onNext(isEmpty ? .empty : .nonEmpty) - } - public func startSearchFlow() { let searchCoordinator = coordinatorProvider.makeSearchCoordinator( parent: self, diff --git a/Projects/Feature/HomeFeature/Implement/Sources/Dependencies.swift b/Projects/Feature/HomeFeature/Implement/Sources/Dependencies.swift new file mode 100644 index 00000000..2d5f5a14 --- /dev/null +++ b/Projects/Feature/HomeFeature/Implement/Sources/Dependencies.swift @@ -0,0 +1,9 @@ +// +// Dependencies.swift +// HomeFeatureInterface +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +@_exported import HomeFeatureInterface diff --git a/Projects/Feature/HomeFeature/Sources/View/EmptyFavoritesView.swift b/Projects/Feature/HomeFeature/Implement/Sources/View/EmptyFavoritesView.swift similarity index 100% rename from Projects/Feature/HomeFeature/Sources/View/EmptyFavoritesView.swift rename to Projects/Feature/HomeFeature/Implement/Sources/View/EmptyFavoritesView.swift diff --git a/Projects/Feature/HomeFeature/Sources/View/FavoritesHeaderView.swift b/Projects/Feature/HomeFeature/Implement/Sources/View/FavoritesHeaderView.swift similarity index 100% rename from Projects/Feature/HomeFeature/Sources/View/FavoritesHeaderView.swift rename to Projects/Feature/HomeFeature/Implement/Sources/View/FavoritesHeaderView.swift diff --git a/Projects/Feature/HomeFeature/Sources/View/FavoritesTVCell.swift b/Projects/Feature/HomeFeature/Implement/Sources/View/FavoritesTVCell.swift similarity index 100% rename from Projects/Feature/HomeFeature/Sources/View/FavoritesTVCell.swift rename to Projects/Feature/HomeFeature/Implement/Sources/View/FavoritesTVCell.swift diff --git a/Projects/Feature/HomeFeature/Sources/ViewController/FavoritesViewController.swift b/Projects/Feature/HomeFeature/Implement/Sources/ViewController/FavoritesViewController.swift similarity index 100% rename from Projects/Feature/HomeFeature/Sources/ViewController/FavoritesViewController.swift rename to Projects/Feature/HomeFeature/Implement/Sources/ViewController/FavoritesViewController.swift diff --git a/Projects/Feature/HomeFeature/Sources/ViewModel/FavoritesViewModel.swift b/Projects/Feature/HomeFeature/Implement/Sources/ViewModel/FavoritesViewModel.swift similarity index 100% rename from Projects/Feature/HomeFeature/Sources/ViewModel/FavoritesViewModel.swift rename to Projects/Feature/HomeFeature/Implement/Sources/ViewModel/FavoritesViewModel.swift diff --git a/Projects/Feature/HomeFeature/Interface/Sources/HomeCoordinator.swift b/Projects/Feature/HomeFeature/Interface/Sources/HomeCoordinator.swift new file mode 100644 index 00000000..c13eec21 --- /dev/null +++ b/Projects/Feature/HomeFeature/Interface/Sources/HomeCoordinator.swift @@ -0,0 +1,23 @@ +// +// HomeCoordinator.swift +// HomeFeatureInterface +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +import UIKit + +import FeatureDependency + +public protocol HomeCoordinator: Coordinator { + func startSearchFlow() + func startBusStopFlow(stationId: String) +} + +public protocol HomeCoordinatorBuilder { + func build( + parent: Coordinator, + navigationController: UINavigationController + ) -> HomeCoordinator +} diff --git a/Projects/Feature/HomeFeature/Project.swift b/Projects/Feature/HomeFeature/Project.swift index fa28c993..2572562f 100644 --- a/Projects/Feature/HomeFeature/Project.swift +++ b/Projects/Feature/HomeFeature/Project.swift @@ -5,10 +5,15 @@ let project = Project( name: "HomeFeature", options: .options(automaticSchemesOptions: .disabled) ) { - Feature(name: "HomeFeature") { + FeatureInterface(name: "HomeFeature") { FeatureDependency() FeatureSwiftLintScript() FrameworkInfoPlist(marketingVersion: .marketingVersion) + } + FeatureImplement(name: "HomeFeature") { + FeatureInterface(name: "HomeFeature") + FeatureSwiftLintScript() + FrameworkInfoPlist(marketingVersion: .marketingVersion) SecretInfoPlist() } SampleApp(name: "HomeFeature") { diff --git a/Projects/FeatureDependency/Sources/Coordinator/HomeCoordinator.swift b/Projects/FeatureDependency/Sources/Coordinator/HomeCoordinator.swift deleted file mode 100644 index 01e4bbc1..00000000 --- a/Projects/FeatureDependency/Sources/Coordinator/HomeCoordinator.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// HomeCoordinator.swift -// FeatureDependency -// -// Created by gnksbm on 1/26/24. -// Copyright © 2024 Pepsi-Club. All rights reserved. -// - -import Foundation - -public protocol HomeCoordinator: Coordinator { - func updateFavoritesState(isEmpty: Bool) - func startSearchFlow() - func startBusStopFlow(stationId: String) -} diff --git a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift index c6f6323b..221a055a 100644 --- a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift +++ b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift @@ -51,23 +51,17 @@ public final class MockCoordinator: Coordinator { } } -extension MockCoordinator: HomeCoordinator { - public func updateFavoritesState(isEmpty: Bool) { - - } - - public func startBusStopFlow(stationId: String) { +extension MockCoordinator: SearchCoordinator { + public func startNearMapFlow(busStopId: String) { let coordinator = MockCoordinator( - testMessage: "BusStopFlow - busStopId: \(stationId)", + testMessage: "\(#function)", navigationController: navigationController ) coordinator.start() childs.append(coordinator) } -} - -extension MockCoordinator: SearchCoordinator { - public func startNearMapFlow(busStopId: String) { + + public func startNearMapFlow() { let coordinator = MockCoordinator( testMessage: "\(#function)", navigationController: navigationController @@ -76,7 +70,7 @@ extension MockCoordinator: SearchCoordinator { childs.append(coordinator) } - public func startNearMapFlow() { + public func startBusStopFlow(stationId: String) { let coordinator = MockCoordinator( testMessage: "\(#function)", navigationController: navigationController diff --git a/Projects/MainFeature/Sources/TabBarCoordinator.swift b/Projects/MainFeature/Sources/TabBarCoordinator.swift index 497983bc..c7cf7136 100644 --- a/Projects/MainFeature/Sources/TabBarCoordinator.swift +++ b/Projects/MainFeature/Sources/TabBarCoordinator.swift @@ -11,7 +11,7 @@ import UIKit import DesignSystem import FeatureDependency -import HomeFeature +import HomeFeatureInterface import AlarmFeature import SettingsFeature @@ -20,14 +20,17 @@ public final class TabBarCoordinator: Coordinator { public var childs: [Coordinator] = [] public var navigationController: UINavigationController public let coordinatorProvider: CoordinatorProvider + public let homeCoordinatorBuilder: HomeCoordinatorBuilder public var coordinatorType: CoordinatorType = .tab public init( navigationController: UINavigationController, - coordinatorProvider: CoordinatorProvider + coordinatorProvider: CoordinatorProvider, + homeCoordinatorBuilder: HomeCoordinatorBuilder ) { self.navigationController = navigationController self.coordinatorProvider = coordinatorProvider + self.homeCoordinatorBuilder = homeCoordinatorBuilder } public func start() { @@ -69,10 +72,9 @@ public final class TabBarCoordinator: Coordinator { var coordinator: Coordinator switch tabKind { case .home: - coordinator = DefaultHomeCoordinator( - parent: self, - navigationController: navigationController, - coordinatorProvider: coordinatorProvider + coordinator = homeCoordinatorBuilder.build( + parent: self, + navigationController: navigationController ) case .settings: coordinator = DefaultSettingsCoordinator( From 3edad0cf09638f10d3dcaedf8561238791d64a50 Mon Sep 17 00:00:00 2001 From: Geonseob Kim <109283556+gnksbm@users.noreply.github.com> Date: Mon, 21 Jul 2025 02:22:29 +0900 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20AlarmFeature=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Target/Feature/FeatureImplement.swift | 2 +- .../Target/Feature/FeatureInterface.swift | 14 ++------ .../Target/Feature/FeatureTesting.swift | 33 +++++++++++++++++++ .../Sources/Coordinator/AppCoordinator.swift | 4 ++- .../Sources/DefaultCoordinatorProvider.swift | 23 +++++++++++-- .../DefaultAddRegularAlarmCoordinator.swift | 19 ++++------- .../DefaultRegularAlarmCoordinator.swift | 0 .../Implement/Sources/Dependencies.swift | 9 +++++ .../Sources/View/EmptyRegularAlarmView.swift | 0 .../Sources/View/RegularAlarmTVCell.swift | 0 .../AddRegularAlarmViewController.swift | 0 .../RegularAlarmViewController.swift | 0 .../ViewModel/AddRegularAlarmViewModel.swift | 13 ++++++++ .../ViewModel/RegularAlarmViewModel.swift | 1 + .../Sources/AddRegularAlarmCoordinator.swift | 23 +++++++++++++ .../Interface/Sources/Dependencies.swift | 10 ++++++ .../Sources}/RegularAlarmCoordinator.swift | 10 ++++-- Projects/Feature/AlarmFeature/Project.swift | 12 ++++++- .../Testing/Sources/Dependencies.swift | 10 ++++++ ...ockAddRegularAlarmCoordinatorBuilder.swift | 25 ++++++++++++++ .../BusStopFeature/Demo/SceneDelegate.swift | 9 +++-- Projects/Feature/BusStopFeature/Project.swift | 3 ++ .../DafaultBusStopCoordinator.swift | 21 +++++++----- .../Sources/ViewModel/BusStopViewModel.swift | 6 +--- .../Coordinator/DefaultHomeCoordinator.swift | 6 ++-- .../DafaultNearMapCoordinator.swift | 3 +- Projects/Feature/NearMapFeature/Project.swift | 6 ++++ .../Testing/Sources/Dependencies.swift | 10 ++++++ .../MockNearMapCoordinatorBuilder.swift | 29 ++++++++++++++++ .../DafaultSearchCoordinator.swift | 14 +++++--- .../Sources/ViewModel/SearchViewModel.swift | 4 +-- .../AddRegularAlarmCoordinator.swift | 17 ---------- .../Coordinator/BusStopCoordinator.swift | 8 ++++- .../Sources/Coordinator/Coordinator.swift | 16 --------- .../Coordinator/CoordinatorProvider.swift | 12 +++---- .../Coordinator/SearchCoordinator.swift | 4 +-- .../Sources/Mock/MockCoordinator.swift | 21 +++--------- .../Mock/MockCoordinatorProvider.swift | 18 +++------- 38 files changed, 286 insertions(+), 129 deletions(-) create mode 100644 Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureTesting.swift rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift (86%) rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift (100%) create mode 100644 Projects/Feature/AlarmFeature/Implement/Sources/Dependencies.swift rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/View/EmptyRegularAlarmView.swift (100%) rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/View/RegularAlarmTVCell.swift (100%) rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/ViewController/AddRegularAlarmViewController.swift (100%) rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/ViewController/RegularAlarmViewController.swift (100%) rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/ViewModel/AddRegularAlarmViewModel.swift (90%) rename Projects/Feature/AlarmFeature/{ => Implement}/Sources/ViewModel/RegularAlarmViewModel.swift (98%) create mode 100644 Projects/Feature/AlarmFeature/Interface/Sources/AddRegularAlarmCoordinator.swift create mode 100644 Projects/Feature/AlarmFeature/Interface/Sources/Dependencies.swift rename Projects/{FeatureDependency/Sources/Coordinator => Feature/AlarmFeature/Interface/Sources}/RegularAlarmCoordinator.swift (54%) create mode 100644 Projects/Feature/AlarmFeature/Testing/Sources/Dependencies.swift create mode 100644 Projects/Feature/AlarmFeature/Testing/Sources/MockAddRegularAlarmCoordinatorBuilder.swift create mode 100644 Projects/Feature/NearMapFeature/Testing/Sources/Dependencies.swift create mode 100644 Projects/Feature/NearMapFeature/Testing/Sources/MockNearMapCoordinatorBuilder.swift delete mode 100644 Projects/FeatureDependency/Sources/Coordinator/AddRegularAlarmCoordinator.swift diff --git a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift index a34ea2cc..e6bb104b 100644 --- a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift +++ b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureImplement.swift @@ -18,7 +18,7 @@ public struct FeatureImplement: ImplementTarget { public var sources: SourceFilesList? { ["Implement/Sources/**"] } public var resources: ResourceFileElements? { hasResource ? ["Implement/Resources/**"] : nil } public var targetDependencyPath: Path { - .relativeToRoot("Projects/Feature/\(name)/Implement") + .relativeToRoot("Projects/Feature/\(name)") } public init( diff --git a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift index 5e31d197..c70de0e5 100644 --- a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift +++ b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureInterface.swift @@ -14,6 +14,9 @@ public struct FeatureInterface: BundleIDSuffixTarget, LocalDependency { public var name: String { projectName + "Interface" } public var product: Product { .framework } public var sources: SourceFilesList? { ["Interface/Sources/**"] } + public var targetDependencyPath: Path { + .relativeToRoot("Projects/Feature/\(projectName)") + } public init( name: String, @@ -25,15 +28,4 @@ public struct FeatureInterface: BundleIDSuffixTarget, LocalDependency { self.scripts = builder.buildTargetScript() self.infoPlist = builder.buildInfoPlist() } - - public var targetDependencyPath: Path { - .relativeToRoot("Projects/Feature/\(projectName)") - } - -// public func buildTargetDependency() -> [TargetDependency] { -// [ -// .pro -// .target(name: name, status: .optional, condition: nil) -// ] -// } } diff --git a/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureTesting.swift b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureTesting.swift new file mode 100644 index 00000000..cf3730ed --- /dev/null +++ b/Plugins/EnvironmentPlugin/ProjectDescriptionHelpers/Buildable/TargetBuildable/Target/Feature/FeatureTesting.swift @@ -0,0 +1,33 @@ +// +// FeatureTesting.swift +// EnvironmentPlugin +// +// Created by gnksbm on 7/19/25. +// + +import Foundation + +public struct FeatureTesting: BundleIDSuffixTarget, LocalDependency { + public var projectName: String + public let dependencies: [TargetDependency] + public let infoPlist: InfoPlist? + public let scripts: [TargetScript] + + public var name: String { projectName + "Testing" } + public var product: Product { .framework } + public var sources: SourceFilesList? { ["Testing/Sources/**"] } + public var targetDependencyPath: Path { + .relativeToRoot("Projects/Feature/\(projectName)") + } + + public init( + name: String, + @TargetComponentBuilder dependencies builder: () -> TargetComponentBuilder = { .init() } + ) { + let builder = builder() + self.projectName = name + self.dependencies = builder.buildTargetDependency() + self.scripts = builder.buildTargetScript() + self.infoPlist = builder.buildInfoPlist() + } +} diff --git a/Projects/App/Sources/Coordinator/AppCoordinator.swift b/Projects/App/Sources/Coordinator/AppCoordinator.swift index 4b8ca8e1..1ba7c29e 100644 --- a/Projects/App/Sources/Coordinator/AppCoordinator.swift +++ b/Projects/App/Sources/Coordinator/AppCoordinator.swift @@ -54,7 +54,9 @@ final class AppCoordinator: Coordinator { busStopId: busStopId, coordinatorProvider: coordinatorProvider, flow: .fromHome, - nearMapCoordinatorBuilder: coordinatorProvider + nearMapCoordinatorBuilder: coordinatorProvider, + addRegularAlarmCoordinatorBuilder: coordinatorProvider, + delegate: nil ) childs.append(busStopCoordinator) busStopCoordinator.start() diff --git a/Projects/App/Sources/DefaultCoordinatorProvider.swift b/Projects/App/Sources/DefaultCoordinatorProvider.swift index b1a050dc..2b9e5d0b 100644 --- a/Projects/App/Sources/DefaultCoordinatorProvider.swift +++ b/Projects/App/Sources/DefaultCoordinatorProvider.swift @@ -16,6 +16,7 @@ import BusStopFeature import NearMapFeature import NearMapFeatureInterface import HomeFeatureInterface +import AlarmFeatureInterface import Domain final class DefaultCoordinatorProvider: CoordinatorProvider { @@ -23,7 +24,8 @@ final class DefaultCoordinatorProvider: CoordinatorProvider { parent: Coordinator, navigationController: UINavigationController, busStopId: String, - flow: FlowState + flow: FlowState, + delegate: BusStopCoordinatorDelegate? ) -> BusStopCoordinator { DefaultBusStopCoordinator( parent: parent, @@ -31,20 +33,24 @@ final class DefaultCoordinatorProvider: CoordinatorProvider { busStopId: busStopId, coordinatorProvider: self, flow: flow, - nearMapCoordinatorBuilder: self + nearMapCoordinatorBuilder: self, + addRegularAlarmCoordinatorBuilder: self, + delegate: delegate ) } func makeSearchCoordinator( parent: Coordinator, navigationController: UINavigationController, - flow: FlowState + flow: FlowState, + busStopCoordinatorDelegate: BusStopCoordinatorDelegate? ) -> SearchCoordinator { DefaultSearchCoordinator( parent: parent, navigationController: navigationController, coordinatorProvider: self, nearMapCoordinatorBuilder: self, + busStopCoordinatorDelegate: busStopCoordinatorDelegate, flow: flow ) } @@ -63,6 +69,17 @@ final class DefaultCoordinatorProvider: CoordinatorProvider { } } +extension DefaultCoordinatorProvider: AddRegularAlarmCoordinatorBuilder { + func build(parent: any Coordinator, navigationController: UINavigationController, flow: FlowState) -> any AddRegularAlarmCoordinator { + DefaultAddRegularAlarmCoordinator( + parent: parent, + navigationController: navigationController, + coordinatorProvider: self, + flow: .fromAlarm + ) + } +} + extension DefaultCoordinatorProvider: HomeCoordinatorBuilder { func build(parent: any Coordinator, navigationController: UINavigationController) -> HomeCoordinator { DefaultHomeCoordinator( diff --git a/Projects/Feature/AlarmFeature/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift b/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift similarity index 86% rename from Projects/Feature/AlarmFeature/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift index 59de2018..06e33f8e 100644 --- a/Projects/Feature/AlarmFeature/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift +++ b/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift @@ -20,6 +20,7 @@ public final class DefaultAddRegularAlarmCoordinator { public var coordinatorType: CoordinatorType = .addAlarm private var vcForFinishFlow: UIViewController? + private weak var viewModel: AddRegularAlarmViewModel? public init( parent: Coordinator, @@ -34,11 +35,7 @@ public final class DefaultAddRegularAlarmCoordinator { } public func start() { - let addRegularAlarmViewController = AddRegularAlarmViewController( - viewModel: .init( - coordinator: self - ) - ) + let addRegularAlarmViewController = AddRegularAlarmViewController(viewModel: .init(coordinator: self)) vcForFinishFlow = addRegularAlarmViewController navigationController.pushViewController( addRegularAlarmViewController, @@ -49,12 +46,9 @@ public final class DefaultAddRegularAlarmCoordinator { extension DefaultAddRegularAlarmCoordinator: AddRegularAlarmCoordinator { public func start(with: RegularAlarmResponse) { - let addRegularAlarmViewController = AddRegularAlarmViewController( - viewModel: .init( - alarmToEdit: with, - coordinator: self - ) - ) + let viewModel = AddRegularAlarmViewModel(alarmToEdit: with, coordinator: self) + let addRegularAlarmViewController = AddRegularAlarmViewController(viewModel: viewModel) + self.viewModel = viewModel vcForFinishFlow = addRegularAlarmViewController navigationController.pushViewController( addRegularAlarmViewController, @@ -66,7 +60,8 @@ extension DefaultAddRegularAlarmCoordinator: AddRegularAlarmCoordinator { let searchCoordinator = coordinatorProvider.makeSearchCoordinator( parent: self, navigationController: navigationController, - flow: .fromAlarm + flow: .fromAlarm, + busStopCoordinatorDelegate: viewModel ) childs.append(searchCoordinator) searchCoordinator.start() diff --git a/Projects/Feature/AlarmFeature/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift b/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift similarity index 100% rename from Projects/Feature/AlarmFeature/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift diff --git a/Projects/Feature/AlarmFeature/Implement/Sources/Dependencies.swift b/Projects/Feature/AlarmFeature/Implement/Sources/Dependencies.swift new file mode 100644 index 00000000..18a6c225 --- /dev/null +++ b/Projects/Feature/AlarmFeature/Implement/Sources/Dependencies.swift @@ -0,0 +1,9 @@ +// +// Dependencies.swift +// AlarmFeatureInterface +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +@_exported import AlarmFeatureInterface diff --git a/Projects/Feature/AlarmFeature/Sources/View/EmptyRegularAlarmView.swift b/Projects/Feature/AlarmFeature/Implement/Sources/View/EmptyRegularAlarmView.swift similarity index 100% rename from Projects/Feature/AlarmFeature/Sources/View/EmptyRegularAlarmView.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/View/EmptyRegularAlarmView.swift diff --git a/Projects/Feature/AlarmFeature/Sources/View/RegularAlarmTVCell.swift b/Projects/Feature/AlarmFeature/Implement/Sources/View/RegularAlarmTVCell.swift similarity index 100% rename from Projects/Feature/AlarmFeature/Sources/View/RegularAlarmTVCell.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/View/RegularAlarmTVCell.swift diff --git a/Projects/Feature/AlarmFeature/Sources/ViewController/AddRegularAlarmViewController.swift b/Projects/Feature/AlarmFeature/Implement/Sources/ViewController/AddRegularAlarmViewController.swift similarity index 100% rename from Projects/Feature/AlarmFeature/Sources/ViewController/AddRegularAlarmViewController.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/ViewController/AddRegularAlarmViewController.swift diff --git a/Projects/Feature/AlarmFeature/Sources/ViewController/RegularAlarmViewController.swift b/Projects/Feature/AlarmFeature/Implement/Sources/ViewController/RegularAlarmViewController.swift similarity index 100% rename from Projects/Feature/AlarmFeature/Sources/ViewController/RegularAlarmViewController.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/ViewController/RegularAlarmViewController.swift diff --git a/Projects/Feature/AlarmFeature/Sources/ViewModel/AddRegularAlarmViewModel.swift b/Projects/Feature/AlarmFeature/Implement/Sources/ViewModel/AddRegularAlarmViewModel.swift similarity index 90% rename from Projects/Feature/AlarmFeature/Sources/ViewModel/AddRegularAlarmViewModel.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/ViewModel/AddRegularAlarmViewModel.swift index ad75e1d8..37ac4cde 100644 --- a/Projects/Feature/AlarmFeature/Sources/ViewModel/AddRegularAlarmViewModel.swift +++ b/Projects/Feature/AlarmFeature/Implement/Sources/ViewModel/AddRegularAlarmViewModel.swift @@ -139,3 +139,16 @@ extension AddRegularAlarmViewModel { let regularAlarm: BehaviorRelay } } + +extension AddRegularAlarmViewModel: BusStopCoordinatorDelegate { + func didSelect(busStopInfo: BusStopArrivalInfoResponse, busInfo: BusArrivalInfoResponse) { + regularAlarmEditingService.update( + busStopId: busStopInfo.busStopId, + busStopName: busStopInfo.busStopName, + busId: busInfo.busId, + busName: busInfo.busName, + adirection: busInfo.adirection + ) + coordinator.removeChildViewController() + } +} diff --git a/Projects/Feature/AlarmFeature/Sources/ViewModel/RegularAlarmViewModel.swift b/Projects/Feature/AlarmFeature/Implement/Sources/ViewModel/RegularAlarmViewModel.swift similarity index 98% rename from Projects/Feature/AlarmFeature/Sources/ViewModel/RegularAlarmViewModel.swift rename to Projects/Feature/AlarmFeature/Implement/Sources/ViewModel/RegularAlarmViewModel.swift index 1241ad3e..9019d9ad 100644 --- a/Projects/Feature/AlarmFeature/Sources/ViewModel/RegularAlarmViewModel.swift +++ b/Projects/Feature/AlarmFeature/Implement/Sources/ViewModel/RegularAlarmViewModel.swift @@ -3,6 +3,7 @@ import Foundation import Core import Domain import FeatureDependency +import AlarmFeatureInterface import RxSwift diff --git a/Projects/Feature/AlarmFeature/Interface/Sources/AddRegularAlarmCoordinator.swift b/Projects/Feature/AlarmFeature/Interface/Sources/AddRegularAlarmCoordinator.swift new file mode 100644 index 00000000..9274df26 --- /dev/null +++ b/Projects/Feature/AlarmFeature/Interface/Sources/AddRegularAlarmCoordinator.swift @@ -0,0 +1,23 @@ +// +// AddRegularAlarmCoordinator.swift +// AlarmFeatureInterface +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +import UIKit + +public protocol AddRegularAlarmCoordinator: Coordinator { + func start(with: RegularAlarmResponse) + func startSearchFlow() + func removeChildViewController() +} + +public protocol AddRegularAlarmCoordinatorBuilder { + func build( + parent: Coordinator, + navigationController: UINavigationController, + flow: FlowState + ) -> AddRegularAlarmCoordinator +} diff --git a/Projects/Feature/AlarmFeature/Interface/Sources/Dependencies.swift b/Projects/Feature/AlarmFeature/Interface/Sources/Dependencies.swift new file mode 100644 index 00000000..fe416f61 --- /dev/null +++ b/Projects/Feature/AlarmFeature/Interface/Sources/Dependencies.swift @@ -0,0 +1,10 @@ +// +// Dependencies.swift +// AlarmFeatureInterface +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +@_exported import FeatureDependency +@_exported import Domain diff --git a/Projects/FeatureDependency/Sources/Coordinator/RegularAlarmCoordinator.swift b/Projects/Feature/AlarmFeature/Interface/Sources/RegularAlarmCoordinator.swift similarity index 54% rename from Projects/FeatureDependency/Sources/Coordinator/RegularAlarmCoordinator.swift rename to Projects/Feature/AlarmFeature/Interface/Sources/RegularAlarmCoordinator.swift index a56e2aea..fed39e8f 100644 --- a/Projects/FeatureDependency/Sources/Coordinator/RegularAlarmCoordinator.swift +++ b/Projects/Feature/AlarmFeature/Interface/Sources/RegularAlarmCoordinator.swift @@ -1,6 +1,12 @@ -import Foundation +// +// RegularAlarmCoordinator.swift +// AlarmFeature +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// -import Domain +import Foundation public protocol RegularAlarmCoordinator: Coordinator { func startAddRegularAlarmFlow() diff --git a/Projects/Feature/AlarmFeature/Project.swift b/Projects/Feature/AlarmFeature/Project.swift index 5e825c74..bf6b3be6 100644 --- a/Projects/Feature/AlarmFeature/Project.swift +++ b/Projects/Feature/AlarmFeature/Project.swift @@ -5,10 +5,20 @@ let project = Project( name: "AlarmFeature", options: .options(automaticSchemesOptions: .disabled) ) { - Feature(name: "AlarmFeature") { + FeatureInterface(name: "AlarmFeature") { FeatureDependency() FeatureSwiftLintScript() FrameworkInfoPlist(marketingVersion: .marketingVersion) + } + FeatureImplement(name: "AlarmFeature") { + FeatureInterface(name: "AlarmFeature") + FeatureSwiftLintScript() + FrameworkInfoPlist(marketingVersion: .marketingVersion) + } + FeatureTesting(name: "AlarmFeature") { + FeatureImplement(name: "AlarmFeature") + FeatureSwiftLintScript() + FrameworkInfoPlist(marketingVersion: .marketingVersion) SecretInfoPlist() } SampleApp(name: "AlarmFeature") { diff --git a/Projects/Feature/AlarmFeature/Testing/Sources/Dependencies.swift b/Projects/Feature/AlarmFeature/Testing/Sources/Dependencies.swift new file mode 100644 index 00000000..54696bdf --- /dev/null +++ b/Projects/Feature/AlarmFeature/Testing/Sources/Dependencies.swift @@ -0,0 +1,10 @@ +// +// Dependencies.swift +// AlarmFeatureTesting +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +@_exported import AlarmFeature +@_exported import AlarmFeatureInterface diff --git a/Projects/Feature/AlarmFeature/Testing/Sources/MockAddRegularAlarmCoordinatorBuilder.swift b/Projects/Feature/AlarmFeature/Testing/Sources/MockAddRegularAlarmCoordinatorBuilder.swift new file mode 100644 index 00000000..18e36c00 --- /dev/null +++ b/Projects/Feature/AlarmFeature/Testing/Sources/MockAddRegularAlarmCoordinatorBuilder.swift @@ -0,0 +1,25 @@ +// +// MockAddRegularAlarmCoordinatorBuilder.swift +// AlarmFeatureTesting +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +import UIKit + +public final class MockAddRegularAlarmCoordinatorBuilder: AddRegularAlarmCoordinatorBuilder { + public init() { } + public func build( + parent: Coordinator, + navigationController: UINavigationController, + flow: FlowState + ) -> AddRegularAlarmCoordinator { + DefaultAddRegularAlarmCoordinator( + parent: parent, + navigationController: navigationController, + coordinatorProvider: MockCoordinatorProvider(), + flow: flow + ) + } +} diff --git a/Projects/Feature/BusStopFeature/Demo/SceneDelegate.swift b/Projects/Feature/BusStopFeature/Demo/SceneDelegate.swift index 1868c0f0..c4348855 100644 --- a/Projects/Feature/BusStopFeature/Demo/SceneDelegate.swift +++ b/Projects/Feature/BusStopFeature/Demo/SceneDelegate.swift @@ -3,6 +3,8 @@ import UIKit import FeatureDependency import Domain import BusStopFeature +import NearMapFeature +import AlarmFeatureTesting final class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? @@ -17,13 +19,16 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { let navigationController = UINavigationController() window?.rootViewController = navigationController window?.makeKeyAndVisible() - + let coordinatorProvider = MockCoordinatorProvider() let busstopCoordinator = DefaultBusStopCoordinator( parent: nil, navigationController: navigationController, busStopId: "", coordinatorProvider: MockCoordinatorProvider(), - flow: .fromHome + flow: .fromHome, + nearMapCoordinatorBuilder: MockNearMapCoordinatorBuilder(), + addRegularAlarmCoordinatorBuilder: MockAddRegularAlarmCoordinatorBuilder(), + delegate: nil ) busstopCoordinator.start() } diff --git a/Projects/Feature/BusStopFeature/Project.swift b/Projects/Feature/BusStopFeature/Project.swift index 23ae13b0..1b72b079 100644 --- a/Projects/Feature/BusStopFeature/Project.swift +++ b/Projects/Feature/BusStopFeature/Project.swift @@ -7,6 +7,7 @@ let project = Project( ) { Feature(name: "BusStopFeature") { FeatureInterface(name: "NearMapFeature") + FeatureInterface(name: "AlarmFeature") FeatureDependency() FeatureSwiftLintScript() FrameworkInfoPlist(marketingVersion: .marketingVersion) @@ -14,6 +15,8 @@ let project = Project( } SampleApp(name: "BusStopFeature") { Feature(name: "BusStopFeature") + Feature(name: "NearMapFeature") + FeatureTesting(name: "AlarmFeature") UIKitInfoPlist() AppInfoPlist( displayName: "BusStopFeatureSampleApp", diff --git a/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift b/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift index aad6dbee..bfeaafbe 100644 --- a/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift +++ b/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift @@ -3,17 +3,20 @@ import UIKit import Domain import FeatureDependency import NearMapFeatureInterface +import AlarmFeatureInterface public final class DefaultBusStopCoordinator: BusStopCoordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] public var navigationController: UINavigationController public var coordinatorType: CoordinatorType = .busStop + public weak var delegate: BusStopCoordinatorDelegate? private let coordinatorProvider: CoordinatorProvider private let busStopId: String private let flow: FlowState private let nearMapCoordinatorBuilder: NearMapCoordinatorBuilder + private let addRegularAlarmCoordinatorBuilder: AddRegularAlarmCoordinatorBuilder public init( parent: Coordinator?, @@ -21,7 +24,9 @@ public final class DefaultBusStopCoordinator: BusStopCoordinator { busStopId: String, coordinatorProvider: CoordinatorProvider, flow: FlowState, - nearMapCoordinatorBuilder: NearMapCoordinatorBuilder + nearMapCoordinatorBuilder: NearMapCoordinatorBuilder, + addRegularAlarmCoordinatorBuilder: AddRegularAlarmCoordinatorBuilder, + delegate: BusStopCoordinatorDelegate? ) { self.parent = parent self.navigationController = navigationController @@ -29,6 +34,8 @@ public final class DefaultBusStopCoordinator: BusStopCoordinator { self.coordinatorProvider = coordinatorProvider self.flow = flow self.nearMapCoordinatorBuilder = nearMapCoordinatorBuilder + self.addRegularAlarmCoordinatorBuilder = addRegularAlarmCoordinatorBuilder + self.delegate = delegate } public func start() { @@ -61,14 +68,12 @@ extension DefaultBusStopCoordinator { } public func moveToRegualrAlarm() { - let alarmCoordinator = coordinatorProvider - .makeAddRegularAlarmCoordinator( - parent: self, - navigationController: navigationController, - flow: .fromAlarm - ) + let alarmCoordinator = addRegularAlarmCoordinatorBuilder.build( + parent: self, + navigationController: navigationController, + flow: .fromAlarm + ) childs.append(alarmCoordinator) alarmCoordinator.start() } - } diff --git a/Projects/Feature/BusStopFeature/Sources/ViewModel/BusStopViewModel.swift b/Projects/Feature/BusStopFeature/Sources/ViewModel/BusStopViewModel.swift index c5882d44..3577018b 100644 --- a/Projects/Feature/BusStopFeature/Sources/ViewModel/BusStopViewModel.swift +++ b/Projects/Feature/BusStopFeature/Sources/ViewModel/BusStopViewModel.swift @@ -152,11 +152,7 @@ public final class BusStopViewModel: ViewModel { .withUnretained(self) .subscribe(onNext: { viewModel, arg1 in let (busInfo, busStopInfo) = arg1 - viewModel.useCase.update( - busStopInfo: busStopInfo, - busInfo: busInfo - ) - viewModel.coordinator.finishFlow(upTo: .addAlarm) + viewModel.coordinator.delegate?.didSelect(busStopInfo: busStopInfo, busInfo: busInfo) }) .disposed(by: disposeBag) diff --git a/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift b/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift index ed368c34..4e9f4f1b 100644 --- a/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift +++ b/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift @@ -53,7 +53,8 @@ extension DefaultHomeCoordinator: HomeCoordinator { let searchCoordinator = coordinatorProvider.makeSearchCoordinator( parent: self, navigationController: navigationController, - flow: .fromHome + flow: .fromHome, + busStopCoordinatorDelegate: nil ) childs.append(searchCoordinator) searchCoordinator.start() @@ -65,7 +66,8 @@ extension DefaultHomeCoordinator: HomeCoordinator { parent: self, navigationController: navigationController, busStopId: stationId, - flow: .fromHome + flow: .fromHome, + delegate: nil ) childs.append(busStopCoordinator) busStopCoordinator.start() diff --git a/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift b/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift index 14bfe09d..793b7196 100644 --- a/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift +++ b/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift @@ -49,7 +49,8 @@ extension DefaultNearMapCoordinator { parent: self, navigationController: navigationController, busStopId: busStopId, - flow: flow + flow: flow, + delegate: nil ) childs.append(busStopCoordinator) busStopCoordinator.start() diff --git a/Projects/Feature/NearMapFeature/Project.swift b/Projects/Feature/NearMapFeature/Project.swift index 68c22bb7..f0f6dfbd 100644 --- a/Projects/Feature/NearMapFeature/Project.swift +++ b/Projects/Feature/NearMapFeature/Project.swift @@ -16,6 +16,12 @@ let project = Project( FrameworkInfoPlist(marketingVersion: .marketingVersion) SecretInfoPlist() } + FeatureTesting(name: "NearMapFeature") { + FeatureImplement(name: "NearMapFeature") + FeatureSwiftLintScript() + FrameworkInfoPlist(marketingVersion: .marketingVersion) + SecretInfoPlist() + } SampleApp(name: "NearMapFeature") { Feature(name: "NearMapFeature") UIKitInfoPlist() diff --git a/Projects/Feature/NearMapFeature/Testing/Sources/Dependencies.swift b/Projects/Feature/NearMapFeature/Testing/Sources/Dependencies.swift new file mode 100644 index 00000000..2a3c46c0 --- /dev/null +++ b/Projects/Feature/NearMapFeature/Testing/Sources/Dependencies.swift @@ -0,0 +1,10 @@ +// +// Dependencies.swift +// NearMapFeature +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +@_exported import NearMapFeature +@_exported import NearMapFeatureInterface diff --git a/Projects/Feature/NearMapFeature/Testing/Sources/MockNearMapCoordinatorBuilder.swift b/Projects/Feature/NearMapFeature/Testing/Sources/MockNearMapCoordinatorBuilder.swift new file mode 100644 index 00000000..64eaf6c3 --- /dev/null +++ b/Projects/Feature/NearMapFeature/Testing/Sources/MockNearMapCoordinatorBuilder.swift @@ -0,0 +1,29 @@ +// +// MockNearMapCoordinatorBuilder.swift +// NearMapFeature +// +// Created by gnksbm on 7/19/25. +// Copyright © 2025 Pepsi-Club. All rights reserved. +// + +import UIKit + +public final class MockNearMapCoordinatorBuilder: NearMapCoordinatorBuilder { + public init() { } + + public func build( + parent: Coordinator, + navigationController: UINavigationController, + flow: FlowState, + busStopId: String? + ) -> NearMapCoordinator { + DefaultNearMapCoordinator( + parent: parent, + navigationController: navigationController, + coordinatorProvider: MockCoordinatorProvider(), + flow: flow, + busStopId: busStopId + ) + } +} + diff --git a/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift b/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift index 382688eb..92dce247 100644 --- a/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift +++ b/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift @@ -9,6 +9,7 @@ public final class DefaultSearchCoordinator: SearchCoordinator { public var childs: [Coordinator] = [] public let navigationController: UINavigationController public var coordinatorType: CoordinatorType = .search + public weak var busStopCoordinatorDelegate: BusStopCoordinatorDelegate? private let coordinatorProvider: CoordinatorProvider private let nearMapCoordinatorBuilder: NearMapCoordinatorBuilder @@ -19,12 +20,14 @@ public final class DefaultSearchCoordinator: SearchCoordinator { navigationController: UINavigationController, coordinatorProvider: CoordinatorProvider, nearMapCoordinatorBuilder: NearMapCoordinatorBuilder, + busStopCoordinatorDelegate: BusStopCoordinatorDelegate?, flow: FlowState ) { self.parent = parent self.navigationController = navigationController self.coordinatorProvider = coordinatorProvider self.nearMapCoordinatorBuilder = nearMapCoordinatorBuilder + self.busStopCoordinatorDelegate = busStopCoordinatorDelegate self.flow = flow } @@ -40,12 +43,13 @@ public final class DefaultSearchCoordinator: SearchCoordinator { } extension DefaultSearchCoordinator { - public func startBusStopFlow(stationId: String) { + public func startBusStopFlow(busStopID: String) { let busStopCoordinator = coordinatorProvider.makeBusStopCoordinator( parent: self, navigationController: navigationController, - busStopId: stationId, - flow: flow + busStopId: busStopID, + flow: flow, + delegate: busStopCoordinatorDelegate ) childs.append(busStopCoordinator) busStopCoordinator.start() @@ -62,12 +66,12 @@ extension DefaultSearchCoordinator { nearMapCoordinator.start() } - public func startNearMapFlow(busStopId: String) { + public func startNearMapFlow(busStopID: String) { let nearMapCoordinator = nearMapCoordinatorBuilder.build( parent: self, navigationController: navigationController, flow: flow, - busStopId: busStopId + busStopId: busStopID ) childs.append(nearMapCoordinator) nearMapCoordinator.start() diff --git a/Projects/Feature/SearchFeature/Sources/ViewModel/SearchViewModel.swift b/Projects/Feature/SearchFeature/Sources/ViewModel/SearchViewModel.swift index c7519a0c..26d1a219 100644 --- a/Projects/Feature/SearchFeature/Sources/ViewModel/SearchViewModel.swift +++ b/Projects/Feature/SearchFeature/Sources/ViewModel/SearchViewModel.swift @@ -65,7 +65,7 @@ public final class SearchViewModel: ViewModel { onNext: { viewModel, response in viewModel.useCase.saveRecentSearch(response: response) viewModel.coordinator.startBusStopFlow( - stationId: response.busStopId + busStopID: response.busStopId ) } ) @@ -90,7 +90,7 @@ public final class SearchViewModel: ViewModel { .withUnretained(self) .subscribe( onNext: { vm, busStopId in - vm.coordinator.startNearMapFlow(busStopId: busStopId) + vm.coordinator.startNearMapFlow(busStopID: busStopId) } ) .disposed(by: disposeBag) diff --git a/Projects/FeatureDependency/Sources/Coordinator/AddRegularAlarmCoordinator.swift b/Projects/FeatureDependency/Sources/Coordinator/AddRegularAlarmCoordinator.swift deleted file mode 100644 index 6491a1b2..00000000 --- a/Projects/FeatureDependency/Sources/Coordinator/AddRegularAlarmCoordinator.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// AddRegularAlarmCoordinator.swift -// AlarmFeature -// -// Created by gnksbm on 2/2/24. -// Copyright © 2024 Pepsi-Club. All rights reserved. -// - -import Foundation - -import Domain - -public protocol AddRegularAlarmCoordinator: Coordinator { - func start(with: RegularAlarmResponse) - func startSearchFlow() - func removeChildViewController() -} diff --git a/Projects/FeatureDependency/Sources/Coordinator/BusStopCoordinator.swift b/Projects/FeatureDependency/Sources/Coordinator/BusStopCoordinator.swift index 1cbe8ff5..b2ba9a10 100644 --- a/Projects/FeatureDependency/Sources/Coordinator/BusStopCoordinator.swift +++ b/Projects/FeatureDependency/Sources/Coordinator/BusStopCoordinator.swift @@ -6,9 +6,15 @@ // Copyright © 2024 Pepsi-Club. All rights reserved. // -import Foundation +import Domain public protocol BusStopCoordinator: Coordinator { + var delegate: BusStopCoordinatorDelegate? { get } + func busStopMapLocation(busStopId: String) func moveToRegualrAlarm() } + +public protocol BusStopCoordinatorDelegate: AnyObject { + func didSelect(busStopInfo: BusStopArrivalInfoResponse, busInfo: BusArrivalInfoResponse) +} diff --git a/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift b/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift index cb2fd62c..0c7f8875 100644 --- a/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift +++ b/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift @@ -35,22 +35,6 @@ public extension Coordinator { parent?.childDidFinish(self) } - func finishFlow( - upTo coordinatorKind: CoordinatorType - ) { - var currentCoordinator: Coordinator = self - var isRoot = false - while !isRoot { - guard let nextCoordinator = currentCoordinator.parent else { break } - currentCoordinator.finish() - currentCoordinator = nextCoordinator - isRoot = currentCoordinator.coordinatorType == coordinatorKind - } - // TODO: 재사용 로직으로 수정 - (currentCoordinator as? AddRegularAlarmCoordinator)? - .removeChildViewController() - } - func openURL(_ url: URL) { parent?.openURL(url) } diff --git a/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift b/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift index 8d6564a7..8362f63d 100644 --- a/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift +++ b/Projects/FeatureDependency/Sources/Coordinator/CoordinatorProvider.swift @@ -14,19 +14,15 @@ public protocol CoordinatorProvider { func makeSearchCoordinator( parent: Coordinator, navigationController: UINavigationController, - flow: FlowState + flow: FlowState, + busStopCoordinatorDelegate: BusStopCoordinatorDelegate? ) -> SearchCoordinator func makeBusStopCoordinator( parent: Coordinator, navigationController: UINavigationController, busStopId: String, - flow: FlowState + flow: FlowState, + delegate: BusStopCoordinatorDelegate? ) -> BusStopCoordinator - - func makeAddRegularAlarmCoordinator( - parent: Coordinator, - navigationController: UINavigationController, - flow: FlowState - ) -> AddRegularAlarmCoordinator } diff --git a/Projects/FeatureDependency/Sources/Coordinator/SearchCoordinator.swift b/Projects/FeatureDependency/Sources/Coordinator/SearchCoordinator.swift index 08f6bc9e..bc311ee5 100644 --- a/Projects/FeatureDependency/Sources/Coordinator/SearchCoordinator.swift +++ b/Projects/FeatureDependency/Sources/Coordinator/SearchCoordinator.swift @@ -10,7 +10,7 @@ import Foundation import Domain public protocol SearchCoordinator: Coordinator { - func startBusStopFlow(stationId: String) + func startBusStopFlow(busStopID: String) func startNearMapFlow() - func startNearMapFlow(busStopId: String) + func startNearMapFlow(busStopID: String) } diff --git a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift index 221a055a..384fb6dc 100644 --- a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift +++ b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift @@ -15,6 +15,7 @@ public final class MockCoordinator: Coordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] public var coordinatorType: CoordinatorType = .home + public var busStopCoordinatorDelegate: BusStopCoordinatorDelegate? private let testMessage: String public var navigationController: UINavigationController @@ -52,7 +53,7 @@ public final class MockCoordinator: Coordinator { } extension MockCoordinator: SearchCoordinator { - public func startNearMapFlow(busStopId: String) { + public func startNearMapFlow(busStopID: String) { let coordinator = MockCoordinator( testMessage: "\(#function)", navigationController: navigationController @@ -70,7 +71,7 @@ extension MockCoordinator: SearchCoordinator { childs.append(coordinator) } - public func startBusStopFlow(stationId: String) { + public func startBusStopFlow(busStopID: String) { let coordinator = MockCoordinator( testMessage: "\(#function)", navigationController: navigationController @@ -87,6 +88,8 @@ extension MockCoordinator: SearchCoordinator { extension MockCoordinator: BusStopCoordinator { + public var delegate: BusStopCoordinatorDelegate? { busStopCoordinatorDelegate } + public func example() { } @@ -110,18 +113,4 @@ extension MockCoordinator: BusStopCoordinator { } } -extension MockCoordinator: AddRegularAlarmCoordinator { - public func start(with: RegularAlarmResponse) { - - } - - public func startSearchFlow() { - - } - - public func removeChildViewController() { - - } -} - #endif diff --git a/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift b/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift index f9cb6ad0..8f560dac 100644 --- a/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift +++ b/Projects/FeatureDependency/Sources/Mock/MockCoordinatorProvider.swift @@ -17,7 +17,8 @@ public final class MockCoordinatorProvider: CoordinatorProvider { public func makeSearchCoordinator( parent: Coordinator, navigationController: UINavigationController, - flow: FlowState + flow: FlowState, + busStopCoordinatorDelegate: BusStopCoordinatorDelegate? ) -> SearchCoordinator { MockCoordinator( testMessage: "Search", @@ -29,23 +30,14 @@ public final class MockCoordinatorProvider: CoordinatorProvider { parent: Coordinator, navigationController: UINavigationController, busStopId: String, - flow: FlowState + flow: FlowState, + delegate: BusStopCoordinatorDelegate? ) -> BusStopCoordinator { MockCoordinator( testMessage: "BusStop - busStopId: \(busStopId)", navigationController: navigationController ) } - - public func makeAddRegularAlarmCoordinator( - parent: Coordinator, - navigationController: UINavigationController, - flow: FlowState - ) -> AddRegularAlarmCoordinator { - MockCoordinator( - testMessage: "AddRegularAlarm", - navigationController: navigationController - ) - } } + #endif From 800fc63e5243eede8ab528d5616a85e4bff20229 Mon Sep 17 00:00:00 2001 From: Geonseob Kim <109283556+gnksbm@users.noreply.github.com> Date: Mon, 28 Jul 2025 22:48:00 +0900 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20CoordinatorType=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Coordinator/AppCoordinator.swift | 2 +- .../Splash/SplashCoordinator.swift | 2 +- .../DefaultAddRegularAlarmCoordinator.swift | 1 - .../DefaultRegularAlarmCoordinator.swift | 1 - .../DafaultBusStopCoordinator.swift | 1 - .../Coordinator/DefaultHomeCoordinator.swift | 1 - .../DafaultNearMapCoordinator.swift | 1 - .../DafaultSearchCoordinator.swift | 1 - .../DefaultSettingsCoordinator.swift | 1 - .../Sources/Coordinator/Coordinator.swift | 1 - .../Sources/Coordinator/CoordinatorType.swift | 22 ------------------- .../Sources/Mock/MockCoordinator.swift | 2 +- .../Sources/TabBarCoordinator.swift | 1 - 13 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 Projects/FeatureDependency/Sources/Coordinator/CoordinatorType.swift diff --git a/Projects/App/Sources/Coordinator/AppCoordinator.swift b/Projects/App/Sources/Coordinator/AppCoordinator.swift index 1ba7c29e..d39776fa 100644 --- a/Projects/App/Sources/Coordinator/AppCoordinator.swift +++ b/Projects/App/Sources/Coordinator/AppCoordinator.swift @@ -23,7 +23,7 @@ final class AppCoordinator: Coordinator { var parent: Coordinator? var childs: [Coordinator] = [] var navigationController: UINavigationController - public var coordinatorType: CoordinatorType = .app + private let coordinatorProvider = DefaultCoordinatorProvider() private let dependency: AppCoordinatorDependency diff --git a/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift b/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift index 98fb5869..1f7a6f14 100644 --- a/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift +++ b/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift @@ -21,7 +21,7 @@ final class SplashCoordinatorImpl: SplashCoordinator { var parent: Coordinator? var childs: [Coordinator] = [] var navigationController: UINavigationController - public var coordinatorType: CoordinatorType = .splash + private let coordinatorProvider: CoordinatorProvider private let homeCoordinatorBuilder: HomeCoordinatorBuilder private let viewModelDependency: SplashViewModelDependency diff --git a/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift b/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift index 06e33f8e..7ea485c2 100644 --- a/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift +++ b/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultAddRegularAlarmCoordinator.swift @@ -17,7 +17,6 @@ public final class DefaultAddRegularAlarmCoordinator { public var navigationController: UINavigationController public let coordinatorProvider: CoordinatorProvider private let flow: FlowState - public var coordinatorType: CoordinatorType = .addAlarm private var vcForFinishFlow: UIViewController? private weak var viewModel: AddRegularAlarmViewModel? diff --git a/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift b/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift index f8676fd8..8f82e05d 100644 --- a/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift +++ b/Projects/Feature/AlarmFeature/Implement/Sources/Coordinator/DefaultRegularAlarmCoordinator.swift @@ -8,7 +8,6 @@ public final class DefaultRegularAlarmCoordinator: RegularAlarmCoordinator { public var childs: [Coordinator] = [] public var navigationController: UINavigationController public var coordinatorProvider: CoordinatorProvider - public var coordinatorType: CoordinatorType = .regularAlarm public init( navigationController: UINavigationController, diff --git a/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift b/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift index bfeaafbe..b36bc8bc 100644 --- a/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift +++ b/Projects/Feature/BusStopFeature/Sources/Coordinator/DafaultBusStopCoordinator.swift @@ -9,7 +9,6 @@ public final class DefaultBusStopCoordinator: BusStopCoordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] public var navigationController: UINavigationController - public var coordinatorType: CoordinatorType = .busStop public weak var delegate: BusStopCoordinatorDelegate? private let coordinatorProvider: CoordinatorProvider diff --git a/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift b/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift index 4e9f4f1b..600fbef9 100644 --- a/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift +++ b/Projects/Feature/HomeFeature/Implement/Sources/Coordinator/DefaultHomeCoordinator.swift @@ -10,7 +10,6 @@ public final class DefaultHomeCoordinator { public var childs: [Coordinator] = [] public var navigationController: UINavigationController public let coordinatorProvider: CoordinatorProvider - public var coordinatorType: CoordinatorType = .home private let favoritesStatus = PublishSubject() private let disposeBag = DisposeBag() diff --git a/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift b/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift index 793b7196..8e237fcb 100644 --- a/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift +++ b/Projects/Feature/NearMapFeature/Implement/Sources/Coordinator/DafaultNearMapCoordinator.swift @@ -11,7 +11,6 @@ public final class DefaultNearMapCoordinator: NearMapCoordinator { public var coordinatorProvider: CoordinatorProvider public let flow: FlowState public let busStopId: String? - public var coordinatorType: CoordinatorType = .nearMap public init( parent: Coordinator?, diff --git a/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift b/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift index 92dce247..8993f435 100644 --- a/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift +++ b/Projects/Feature/SearchFeature/Sources/Coordinator/DafaultSearchCoordinator.swift @@ -8,7 +8,6 @@ public final class DefaultSearchCoordinator: SearchCoordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] public let navigationController: UINavigationController - public var coordinatorType: CoordinatorType = .search public weak var busStopCoordinatorDelegate: BusStopCoordinatorDelegate? private let coordinatorProvider: CoordinatorProvider diff --git a/Projects/Feature/SettingsFeature/Sources/Coordinator/DefaultSettingsCoordinator.swift b/Projects/Feature/SettingsFeature/Sources/Coordinator/DefaultSettingsCoordinator.swift index e6a75f64..e80f6b8a 100644 --- a/Projects/Feature/SettingsFeature/Sources/Coordinator/DefaultSettingsCoordinator.swift +++ b/Projects/Feature/SettingsFeature/Sources/Coordinator/DefaultSettingsCoordinator.swift @@ -6,7 +6,6 @@ public final class DefaultSettingsCoordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] public var navigationController: UINavigationController - public var coordinatorType: CoordinatorType = .setting public init(navigationController: UINavigationController) { self.navigationController = navigationController diff --git a/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift b/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift index 0c7f8875..c6aee168 100644 --- a/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift +++ b/Projects/FeatureDependency/Sources/Coordinator/Coordinator.swift @@ -14,7 +14,6 @@ public protocol Coordinator: AnyObject { var parent: Coordinator? { get set } var childs: [Coordinator] { get set } var navigationController: UINavigationController { get } - var coordinatorType: CoordinatorType { get } func start() func finish() diff --git a/Projects/FeatureDependency/Sources/Coordinator/CoordinatorType.swift b/Projects/FeatureDependency/Sources/Coordinator/CoordinatorType.swift deleted file mode 100644 index 38097bea..00000000 --- a/Projects/FeatureDependency/Sources/Coordinator/CoordinatorType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// CoordinatorType.swift -// FeatureDependency -// -// Created by Jisoo HAM on 3/18/24. -// Copyright © 2024 Pepsi-Club. All rights reserved. -// - -import UIKit - -public enum CoordinatorType { - case app - case splash - case tab - case addAlarm - case home - case search - case nearMap - case busStop - case setting - case regularAlarm -} diff --git a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift index 384fb6dc..2f0c2678 100644 --- a/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift +++ b/Projects/FeatureDependency/Sources/Mock/MockCoordinator.swift @@ -14,7 +14,7 @@ import Domain public final class MockCoordinator: Coordinator { public var parent: Coordinator? public var childs: [Coordinator] = [] - public var coordinatorType: CoordinatorType = .home + public var busStopCoordinatorDelegate: BusStopCoordinatorDelegate? private let testMessage: String diff --git a/Projects/MainFeature/Sources/TabBarCoordinator.swift b/Projects/MainFeature/Sources/TabBarCoordinator.swift index c7cf7136..afe75bcd 100644 --- a/Projects/MainFeature/Sources/TabBarCoordinator.swift +++ b/Projects/MainFeature/Sources/TabBarCoordinator.swift @@ -21,7 +21,6 @@ public final class TabBarCoordinator: Coordinator { public var navigationController: UINavigationController public let coordinatorProvider: CoordinatorProvider public let homeCoordinatorBuilder: HomeCoordinatorBuilder - public var coordinatorType: CoordinatorType = .tab public init( navigationController: UINavigationController, From 823451fcb7d068b5c6ee55ee782c4af6c6399450 Mon Sep 17 00:00:00 2001 From: Geonseob Kim <109283556+gnksbm@users.noreply.github.com> Date: Mon, 28 Jul 2025 23:58:39 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=EC=BD=94=EB=93=9C=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift | 1 - .../App/Sources/Coordinator/Splash/SplashViewController.swift | 1 + Projects/App/Sources/DefaultCoordinatorProvider.swift | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift b/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift index 1f7a6f14..750f0880 100644 --- a/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift +++ b/Projects/App/Sources/Coordinator/Splash/SplashCoordinator.swift @@ -14,7 +14,6 @@ import HomeFeatureInterface protocol SplashCoordinator: Coordinator { func startTabFlow() - func openURL(_ url: URL) } final class SplashCoordinatorImpl: SplashCoordinator { diff --git a/Projects/App/Sources/Coordinator/Splash/SplashViewController.swift b/Projects/App/Sources/Coordinator/Splash/SplashViewController.swift index 82b9ddfb..4e97e456 100644 --- a/Projects/App/Sources/Coordinator/Splash/SplashViewController.swift +++ b/Projects/App/Sources/Coordinator/Splash/SplashViewController.swift @@ -40,6 +40,7 @@ final class SplashViewController: UIViewController { output.alert .observe(on: MainScheduler.instance) .bind(with: self) { owner, alert in + guard !alert.actions.isEmpty else { return } let alertController = UIAlertController( title: alert.title, message: alert.message, diff --git a/Projects/App/Sources/DefaultCoordinatorProvider.swift b/Projects/App/Sources/DefaultCoordinatorProvider.swift index 2b9e5d0b..153e630a 100644 --- a/Projects/App/Sources/DefaultCoordinatorProvider.swift +++ b/Projects/App/Sources/DefaultCoordinatorProvider.swift @@ -75,7 +75,7 @@ extension DefaultCoordinatorProvider: AddRegularAlarmCoordinatorBuilder { parent: parent, navigationController: navigationController, coordinatorProvider: self, - flow: .fromAlarm + flow: flow ) } }