Bez popisu

ContentView.swift 632B

1234567891011121314151617181920212223242526
  1. //
  2. // ContentView.swift
  3. // Comedores Sociales
  4. //
  5. // Created by Hector Carrion on 10/24/20.
  6. //
  7. import SwiftUI
  8. struct ContentView: View {
  9. @StateObject var lvm = LoginViewModel()
  10. @StateObject var rvm = RegisterViewModel()
  11. @StateObject var pvm = ProfileViewModel()
  12. var body: some View {
  13. if lvm.response == .success || rvm.response == .success || UserDefaults.standard.bool(forKey: "logged-in") {
  14. SearchContainer()
  15. .environmentObject(pvm)
  16. } else {
  17. LoginView()
  18. .environmentObject(lvm)
  19. .environmentObject(rvm)
  20. }
  21. }
  22. }