Skip to content

Commit

Permalink
[Feat/#7] SceneDelegate 의존성 주입
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-seonwoo committed Jun 7, 2024
1 parent 7103195 commit 2fb947f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Tving-Clone/Tving-Clone/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
self.window = UIWindow(windowScene: windowScene)
let navigationController = UINavigationController(rootViewController: TabBarController())
self.window?.rootViewController = navigationController
self.window?.makeKeyAndVisible()
}

let contentDataSource = ContentDataSource()
let contentRepository = DefaultContentRepository(contentDataSource: contentDataSource)
let contentUseCase = DefaultContentUseCase(repository: contentRepository)
let mainContentViewModel = MainContentViewModel(contentUseCase: contentUseCase)
let mainContentVC = MainContentViewController(viewModel: mainContentViewModel)

let tabBarController = TabBarController(mainContentViewModel: mainContentViewModel)

window = UIWindow(windowScene: windowScene)
window?.rootViewController = UINavigationController(rootViewController: tabBarController)
window?.makeKeyAndVisible()
}

func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
Expand Down

0 comments on commit 2fb947f

Please sign in to comment.