|
|
@@ -5,28 +5,40 @@
|
|
|
// Created by Pavel Yurchenko on 17.08.2024.
|
|
|
//
|
|
|
|
|
|
+import CoordinatorSUI
|
|
|
import SwiftUI
|
|
|
|
|
|
@main
|
|
|
struct SUIExamplesApp: App {
|
|
|
|
|
|
- @StateObject private var router: Router = DI.shared.router
|
|
|
+ private let applicationCoordinator = ApplicationCoordinator()
|
|
|
+ @State private var router: Router = Router()
|
|
|
+
|
|
|
+ init() {
|
|
|
+ self.applicationCoordinator.currentRouter = router
|
|
|
+ }
|
|
|
|
|
|
var body: some Scene {
|
|
|
WindowGroup {
|
|
|
- NavigationStack(path: $router.path){
|
|
|
+ NavigationStack(path: $router.path) {
|
|
|
MainBuilder().build(
|
|
|
with: .init(
|
|
|
onProducts: {
|
|
|
- router.push(
|
|
|
- .products
|
|
|
+ applicationCoordinator.currentRouter.push(
|
|
|
+ Route.products
|
|
|
)
|
|
|
})
|
|
|
)
|
|
|
.navigationDestination(
|
|
|
- for: Route.self,
|
|
|
- destination: router.buildDestination
|
|
|
- )
|
|
|
+ for: Route.self
|
|
|
+ ) { _ in
|
|
|
+ print("Destination")
|
|
|
+ return EmptyView()
|
|
|
+ }
|
|
|
+// .navigationDestination(
|
|
|
+// for: Route.self,
|
|
|
+// destination: applicationCoordinator.buildDestination
|
|
|
+// )
|
|
|
}
|
|
|
}
|
|
|
}
|