-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69bda45
commit 9e7c121
Showing
3 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// AppDIContainer.swift | ||
// Tving-Clone | ||
// | ||
// Created by Seonwoo Kim on 6/7/24. | ||
// | ||
|
||
import Foundation | ||
|
||
final class AppDIContainer { | ||
|
||
func makeContentSceneDIContainer() -> ContentDIContainer { | ||
let dependencies = ContentDIContainer.Dependencies(contentDataSource: ContentDataSource()) | ||
return ContentDIContainer(dependencies: dependencies) | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
Tving-Clone/Tving-Clone/Application/ContentDIContainer.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// DIConteainer.swift | ||
// Tving-Clone | ||
// | ||
// Created by Seonwoo Kim on 6/7/24. | ||
// | ||
|
||
import Foundation | ||
|
||
final class ContentDIContainer { | ||
|
||
struct Dependencies { | ||
let contentDataSource: ContentDataSource | ||
} | ||
|
||
private let dependencies: Dependencies | ||
|
||
init(dependencies: Dependencies) { | ||
self.dependencies = dependencies | ||
} | ||
|
||
func makeContentRepository() -> ContentRepository { | ||
return DefaultContentRepository(contentDataSource: dependencies.contentDataSource) | ||
} | ||
|
||
func makeContentUseCase() -> ContentUseCase { | ||
return DefaultContentUseCase(repository: makeContentRepository()) | ||
} | ||
|
||
func makeMainContentViewModel() -> MainContentViewModel { | ||
return MainContentViewModel(contentUseCase: makeContentUseCase()) | ||
} | ||
|
||
func makeMainContentViewController() -> MainContentViewController { | ||
return MainContentViewController(viewModel: makeMainContentViewModel()) | ||
} | ||
|
||
func makeTabBarController() -> TabBarController { | ||
return TabBarController(mainContentViewModel: makeMainContentViewModel()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters