|
@@ -12,11 +12,7 @@ import SwiftUI
|
|
|
struct SUIExamplesApp: App {
|
|
struct SUIExamplesApp: App {
|
|
|
|
|
|
|
|
private let applicationCoordinator = ApplicationCoordinator()
|
|
private let applicationCoordinator = ApplicationCoordinator()
|
|
|
- @State private var router: Router = Router()
|
|
|
|
|
-
|
|
|
|
|
- init() {
|
|
|
|
|
- self.applicationCoordinator.currentRouter = router
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @StateObject private var router: Router = ApplicationCoordinator.rootRouter
|
|
|
|
|
|
|
|
var body: some Scene {
|
|
var body: some Scene {
|
|
|
WindowGroup {
|
|
WindowGroup {
|
|
@@ -24,21 +20,15 @@ struct SUIExamplesApp: App {
|
|
|
MainBuilder().build(
|
|
MainBuilder().build(
|
|
|
with: .init(
|
|
with: .init(
|
|
|
onProducts: {
|
|
onProducts: {
|
|
|
- applicationCoordinator.currentRouter.push(
|
|
|
|
|
|
|
+ router.path.append(
|
|
|
Route.products
|
|
Route.products
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
)
|
|
)
|
|
|
.navigationDestination(
|
|
.navigationDestination(
|
|
|
- for: Route.self
|
|
|
|
|
- ) { _ in
|
|
|
|
|
- print("Destination")
|
|
|
|
|
- return EmptyView()
|
|
|
|
|
- }
|
|
|
|
|
-// .navigationDestination(
|
|
|
|
|
-// for: Route.self,
|
|
|
|
|
-// destination: applicationCoordinator.buildDestination
|
|
|
|
|
-// )
|
|
|
|
|
|
|
+ for: Route.self,
|
|
|
|
|
+ destination: applicationCoordinator.buildDestination
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|