Skip to content

Commit

Permalink
[REFACTOR] SplashCoordinator에서 Adaptor생성분리(#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimscastle committed Oct 19, 2023
1 parent 387f95d commit f7ea8f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

import Foundation

final class SplashAdaptor: SplashNavigation {
typealias EntireSplashNavigation = SplashNavigation

final class SplashAdaptor: EntireSplashNavigation {

let coordinator: SplashCoordinator
init(coordinator: SplashCoordinator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import UIKit

protocol SplashFactory {
func makeSplashViewController(adaptor: SplashNavigation) -> SplashViewControllerable
func makeSplashAdaptor(coordinator: SplashCoordinator) -> EntireSplashNavigation
func makeSplashViewController(coordinator: SplashCoordinator) -> SplashViewControllerable
}


0 comments on commit f7ea8f5

Please sign in to comment.