diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/ChallengeAdaptor.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/ChallengeAdaptor.swift index ed0a7420..64b69502 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/ChallengeAdaptor.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Adaptor/ChallengeAdaptor.swift @@ -7,8 +7,9 @@ import Foundation +typealias EntireChallengeNavigation = ChallengeNavigation -final class ChallengeAdaptor: ChallengeNavigation { +final class ChallengeAdaptor: EntireChallengeNavigation { let coordinator: ChallengeCoordinator diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/ChallengeCoordinatorImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/ChallengeCoordinatorImpl.swift index 95a2b5dc..75a8219c 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/ChallengeCoordinatorImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Coordinator/CoordinatorImpl/ChallengeCoordinatorImpl.swift @@ -26,8 +26,7 @@ final class ChallengeCoordinatorImpl: ChallengeCoordinator { } func showChallengeViewController() { - let adaptor = ChallengeAdaptor(coordinator: self) - let challengeViewController = factory.makeChallengeViewController(adaptor: adaptor) + let challengeViewController = factory.makeChallengeViewController(coordinator: self) navigationController.pushViewController(challengeViewController, animated: true) } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ChallengeFactoryImpl.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ChallengeFactoryImpl.swift index ce75aa21..c229e246 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ChallengeFactoryImpl.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryImpl/ChallengeFactoryImpl.swift @@ -8,7 +8,13 @@ import Foundation struct ChallengeFactoryImpl: ChallengeFactory { - func makeChallengeViewController(adaptor: ChallengeAdaptor) -> ChallengeViewControllerable { + func makeAdaptor(coordinator: ChallengeCoordinator) -> ChallengeAdaptor { + let adaptor = ChallengeAdaptor(coordinator: coordinator) + return adaptor + } + + func makeChallengeViewController(coordinator: ChallengeCoordinator) -> ChallengeViewControllerable { + let adaptor = self.makeAdaptor(coordinator: coordinator) return ChallengeViewController(manager: ChallengeManagerImpl(challengeService: ChallengeServiceImpl(apiService: APIService())), navigator: adaptor) } } diff --git a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ChallengeFactory.swift b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ChallengeFactory.swift index e61aa71f..267fd74f 100644 --- a/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ChallengeFactory.swift +++ b/LionHeart-iOS/LionHeart-iOS/Scenes/Factory/FactoryInterface/ChallengeFactory.swift @@ -8,5 +8,6 @@ import Foundation protocol ChallengeFactory { - func makeChallengeViewController(adaptor: ChallengeAdaptor) -> ChallengeViewControllerable + func makeAdaptor(coordinator: ChallengeCoordinator) -> ChallengeAdaptor + func makeChallengeViewController(coordinator: ChallengeCoordinator) -> ChallengeViewControllerable }