From f7ea8f5bc580bfff3a1d2fb9ff86589b52789d26 Mon Sep 17 00:00:00 2001 From: kimscastle Date: Thu, 19 Oct 2023 17:14:05 +0900 Subject: [PATCH] =?UTF-8?q?[REFACTOR]=20SplashCoordinator=EC=97=90?= =?UTF-8?q?=EC=84=9C=20Adaptor=EC=83=9D=EC=84=B1=EB=B6=84=EB=A6=AC(#156)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift | 4 +++- .../CoordinatorImpl/SplashCoordinatorImpl.swift | 3 +-- .../Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift | 8 ++++++-- .../Scenes/Factory/FactoryInterface/SpalshFactory.swift | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift index 3af1cc3e..0daa845d 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/SplashAdaptor.swift @@ -7,7 +7,9 @@ import Foundation -final class SplashAdaptor: SplashNavigation { +typealias EntireSplashNavigation = SplashNavigation + +final class SplashAdaptor: EntireSplashNavigation { let coordinator: SplashCoordinator init(coordinator: SplashCoordinator) { diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/SplashCoordinatorImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/SplashCoordinatorImpl.swift index 51e0451a..3fbc5bd3 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/SplashCoordinatorImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/SplashCoordinatorImpl.swift @@ -26,8 +26,7 @@ final class SplashCoordinatorImpl: SplashCoordinator { } func showSplashViewController() { - let splashAdaptor = SplashAdaptor(coordinator: self) - let splashViewController = factory.makeSplashViewController(adaptor: splashAdaptor) + let splashViewController = factory.makeSplashViewController(coordinator: self) self.navigationController.pushViewController(splashViewController, animated: false) } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift index ecbd9dfb..95aff7d3 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/SplashFactoryImpl.swift @@ -8,7 +8,11 @@ import UIKit struct SplashFactoryImpl: SplashFactory { - func makeSplashViewController(adaptor: SplashNavigation) -> SplashViewControllerable { - return SplashViewController(manager: SplashManagerImpl(authService: AuthServiceImpl(apiService: APIService())), adaptor: adaptor) + func makeSplashAdaptor(coordinator: SplashCoordinator) -> EntireSplashNavigation { + return SplashAdaptor(coordinator: coordinator) + } + + func makeSplashViewController(coordinator: SplashCoordinator) -> SplashViewControllerable { + return SplashViewController(manager: SplashManagerImpl(authService: AuthServiceImpl(apiService: APIService())), adaptor: self.makeSplashAdaptor(coordinator: coordinator)) } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift index 489ab326..7f67370d 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/SpalshFactory.swift @@ -8,7 +8,8 @@ import UIKit protocol SplashFactory { - func makeSplashViewController(adaptor: SplashNavigation) -> SplashViewControllerable + func makeSplashAdaptor(coordinator: SplashCoordinator) -> EntireSplashNavigation + func makeSplashViewController(coordinator: SplashCoordinator) -> SplashViewControllerable }