SUIExamplesApp.swift 895 B

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