Replies: 3 comments 3 replies
-
|
Trying to understand here.... You have an option between seeing 2 columns or 3 columns. You have a view that toggles between 2 and 3, and that selection is floated back to HomeView. HomeView then shows 2 or 3 columns in a NavigationView. A NavigationView with a ColumnNavigationViewStyle? Is all that correct? |
Beta Was this translation helpful? Give feedback.
-
|
So I read your request completely differently. I'm not seeing that you're using
WorkflowLauncher(isLaunched: .constant(true)) {
thenProceed(with: FirstView.self)
}
.onFinish { print($0) } // This'll give you whatever FirstView outputs when `proceedInWorkflow` is called.
WorkflowLauncher(isLaunched: .constant(true), args: $columnSelection) {
thenProceed(with: FirstView.self)
}
struct FirstView: View, FlowRepresentable {
weak var _workflowPointer: AnyFlowRepresentable?
@Binding var columnSelection: <#Type of column selection#>
init(with columnSelection: Binding<<#Type of column selection#>>) {
_columnSelection = columnSelection
}
}Now your binding will be updated just like it would anywhere else. NOTE: None of this code was run through a compiler, it's just off the top of my head. If neither answer is helpful try adding a code snippet so we can grok the problem space a bit more. |
Beta Was this translation helpful? Give feedback.
-
|
@innoreq Did any of this help you out or would you like further assistance? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to get into the secrets of SwiftCurrent, but struggling at several points.
What I'd like to achieve is to set up a home view that is able to switch between a two- and three-column layout, depending on the choice done in the sidebar view.
The problem here is that the sidebar view has
NavigationLinks with aWorkflowLauncherfor each for the destination view.What would be necessary is to hand over somehow an indicator, if the selection shall result in a two- or in a three-column layout.
The
HomeViewitself is just a switch between these two values, with a rootNavigationViewwith two or three destination in it.While this is working in a classic approach, I have no clue how to hand back the selection from the sidebar view to the superior home view. From the documentation I understood that there is no view hierarchy with SwiftCurrent (what's actually what I'd need), but even with the articles, I found no way to do this.
Would be anyone so kind to give me a hint how this can be achieved?
Beta Was this translation helpful? Give feedback.
All reactions