Files
ios-client/IosClientKit/Sources/App/AppContainer.swift
2026-09-14 21:10:44 +08:00

15 lines
472 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import CoreDomain
import CoreRepository
import FeatureHome
/// 手写组合根 / DI 容器(对应 Android Hilt 的 AppContainer)。
@MainActor
public enum AppContainer {
/// 装配 FeatureHome 依赖并返回 ViewModel。
public static func makeHomeViewModel() -> HomeViewModel {
let repository: HomeRepository = FakeHomeRepository()
let useCase = HomeUseCase(repository: repository)
return HomeViewModel(homeUseCase: useCase)
}
}