Replies: 4 comments 11 replies
-
The impression that I have (probably a bad one from my inexperience but the one I got after trying to create the UIKit-support tools myself) is that this conversation is pretty much dead until TCA's SwitchStore and/or CaseLet also has UIKit support. This is important because the StackStore needs to be split to its potential navigation paths that can then be passed to its child view controllers and you can't do something clean like that with Store's ifLet/else UIKit functions. Disclaimer: my codebase is 100% UIKit so I never use UIHostingController or any of that stuff |
Beta Was this translation helpful? Give feedback.
-
What does your |
Beta Was this translation helpful? Give feedback.
-
I had success backporting the stack apis many months ago using navigation-stack-backport, have a look here. The POC was working though there were still some warning from UIKit about some apis that were used in wrong order or thing like that and the initial animation was not perfect IIRC. I had not time to spend on this recently but I hope to in the coming weeks or months. Also if this goes nowhere there is NavigationBackport or FlowStacks which could be used as an alternative. The same guy also made TCACoordinators which is dedicated to TCA but with another approach to navigation. |
Beta Was this translation helpful? Give feedback.
-
+1 for this effort. It would be great to have a backwards compatibility story for stack/tree nav. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey peeps!
I’m trying to incorporate the new
StackState
/StackAction
tools in my app, which should support iOS 15.I have successfully used
NavigationLinkStore
+UINavigationController
pushingUIHostingController
instances, but I'm looking for a way to ease migration, whenever we need to drop iOS 15 support.In a non-TCA context, I have this "pure"
SwiftUI.Representable
. It wraps aUINavigationController
and exposes a pathBinding
, so that the it can be controlled with state, just likeNavigationStack
does. Code here.What I am trying to achieve now, in a TCA world, is to create this wrapper for graceful migration. The idea is to use the same initialiser as
NavigationStackStore
, but internally decide whether to useNavigationStackStore
or "NavigationControllerRepresentableStore
" (name TBD).For that, I am trying to replicate the
NavigationStackStore.init
, and decide whichView
to render in thebody
- but I quickly stumbled upon some private APIs.I realise some of those are “nice-to-haves” (such as
EnvironmentValues.navigationDestinationType
, which is used to provide helpful warning messages rather than deriving actual functionality). However, being unable to incorporate some of the others (such as$0.path
,.invalidate(…)
, and theComponent
type) is a bit of a deal-breaker.Any ideas on how to get this off the ground? Should this be perhaps made available behind a
@_spi(NavigationStackStore)
? Or am I missing a different approach that would allow me to achieve this without mimicking the initialiser?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions