1234567891011121314151617181920212223242526272829303132 |
- //
- // ContentView.swift
- // Shared
- //
- // Created by Sergey Tarasov on 24.07.2022.
- //
- import SwiftUI
- struct ContentView: View {
- @ObservedObject var viewModel: ChatListViewModel = ChatListViewModel()
- @ObservedObject var loginViewModel: LoginViewModel = LoginViewModel()
- @State var authStatus: Bool = false
- var body: some View {
- Group {
- if authStatus {
- NavigationView {
- ChatListView(viewModel: viewModel)
- }
- } else {
- LoginView(viewModel: loginViewModel, authStatus: $authStatus)
- }
- }
- }
- }
- struct ContentView_Previews: PreviewProvider {
- static var previews: some View {
- ContentView()
- }
- }
|