fiveConstantApp.swift 831 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // fiveConstantApp.swift
  3. // fiveConstant
  4. //
  5. // Created by 李建 on 2023/1/11.
  6. //
  7. import SwiftUI
  8. import AlertToast
  9. @main
  10. struct fiveConstantApp: App {
  11. @StateObject var progressState: ProgressState = ProgressState.manager
  12. @StateObject var hudState: HUD = HUD.instance
  13. var body: some Scene {
  14. WindowGroup {
  15. Group {
  16. if progressState.isNeedLogin {
  17. SmsLoginUIView()
  18. } else {
  19. ContentUIView(viewRouter: ViewRouter())
  20. }
  21. }
  22. .toast(isPresenting: $hudState.isPresendted, alert: {
  23. AlertToast(displayMode: hudState.displayMode, type: hudState.type, subTitle: hudState.title)
  24. })
  25. .environmentObject(progressState)
  26. }
  27. }
  28. }