SUIExamplesApp.swift 761 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // SUIExamplesApp.swift
  3. // SUIExamples
  4. //
  5. // Created by Pavel Yurchenko on 17.08.2024.
  6. //
  7. import SwiftUI
  8. @main
  9. struct SUIExamplesApp: App {
  10. @StateObject private var router: Router = DI.shared.router
  11. var body: some Scene {
  12. WindowGroup {
  13. NavigationStack(path: $router.path){
  14. MainBuilder().build(
  15. with: .init(
  16. onProducts: {
  17. router.push(
  18. .products
  19. )
  20. })
  21. )
  22. .navigationDestination(
  23. for: Route.self,
  24. destination: router.buildDestination
  25. )
  26. }
  27. }
  28. }
  29. }