mirror of
https://github.com/metabolist/metatext.git
synced 2024-12-04 06:16:38 +00:00
30 lines
878 B
Swift
30 lines
878 B
Swift
// Copyright © 2021 Metabolist. All rights reserved.
|
|
|
|
import SwiftUI
|
|
import ViewModels
|
|
|
|
struct MainNavigationView: UIViewControllerRepresentable {
|
|
let viewModelClosure: () -> NavigationViewModel
|
|
@EnvironmentObject var rootViewModel: RootViewModel
|
|
|
|
func makeUIViewController(context: Context) -> MainNavigationViewController {
|
|
MainNavigationViewController(
|
|
viewModel: viewModelClosure(),
|
|
rootViewModel: rootViewModel)
|
|
}
|
|
|
|
func updateUIViewController(_ uiViewController: MainNavigationViewController, context: Context) {
|
|
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
import PreviewViewModels
|
|
|
|
struct MainNavigationView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
MainNavigationView { NavigationViewModel(identityContext: .preview, environment: .preview) }
|
|
.environmentObject(RootViewModel.preview)
|
|
}
|
|
}
|
|
#endif
|