metatext/Views/RootView.swift

29 lines
764 B
Swift
Raw Normal View History

2020-08-03 15:20:51 +00:00
// Copyright © 2020 Metabolist. All rights reserved.
import SwiftUI
struct RootView: View {
@StateObject var viewModel: RootViewModel
var body: some View {
2020-08-27 04:25:28 +00:00
if let tabNavigationViewModel = viewModel.tabNavigationViewModel {
TabNavigationView(viewModel: tabNavigationViewModel)
2020-08-09 05:37:04 +00:00
.id(UUID())
2020-08-07 01:41:59 +00:00
.environmentObject(viewModel)
.transition(.opacity)
} else {
AddIdentityView(viewModel: viewModel.addIdentityViewModel())
.environmentObject(viewModel)
.transition(.opacity)
2020-08-03 15:20:51 +00:00
}
}
}
#if DEBUG
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
RootView(viewModel: .development)
}
}
#endif