Closed mojtabasheikhy closed 6 hours ago
Hello! @mojtabasheikhy
There is a lack of clues as to what is wrong or uncomfortable about the issue.
If you have asked about the possibility of using @State in RouteBuilder, it is not possible.
However, it can be used in other ways. You can inject the State value directly into the View. We can also pass dependencies through DependencyType.
I hope this is the correct answer.
To enable enterprise utilization, here is an example available in libraries utilizing various architectures.
Please also refer to the link provided.
dear. @mojtabasheikhy
We will close the issue as there has been no response for 2 weeks. If you provide any additional information, we will proceed with the issue.
Thank you.
struct TurnStatusView: View { @State public var terminal :Terminal public init(terminal : Terminal,navigator : LinkNavigatorType) { self.terminal = terminal } } public struct TurnStatusRouteBuilder: RouteBuilder { public var matchPath: String { "TurnStatus" } public init(){} public var build: (LinkNavigatorType, [String: String], DependencyType) -> MatchingViewController? { { navigator, items, dependency in return WrappingController(matchPath: matchPath) { TurnStatusView(navigator: navigator) } } } } how pass terminal as constructor