Update to the SwiftUI API for the sake of NavigationLinks #113
Richard-Gist
announced in
Spikes and Findings
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While working on issue #101 to enable NavigationLinks, we discovered that the DSL we had decided on and implemented would not work. Fundamentally the API was broken in that our types were nested in the wrong direction. We were forced to correct this issue in PR #111 which now changes the API to nested closures instead of in-line calls.
For anyone currently consuming SwiftUI, you will have to make a couple of changes. Below is an example of what those differences are:
OLD VERSION
NEW VERSION
How to migrate?
While tedious, it is fairly straightforward on how to convert from the OLD version to the NEW version.
WorkflowLauncher
now ends in a closure where you callthenProceed
thenProceed
is now a function onView
and so you remove the.
from the callthenProceed
takes theFlowRepresentable
type directly without the need for instantiating aWorkflowItem
.thenProceed
can also take a closure for the next view in the chain, so you now nest yourthenProceed
calls.applyModifiers
and other methods you would attach to theWorkflowItem
is now called off ofthenProceed
. That means at the end ofthenProceed(with: FR1.self)
or at the end of the closure onthenProceed
.Beta Was this translation helpful? Give feedback.
All reactions