Closed autoreleasefool closed 8 months ago
Hi @autoreleasefool, thanks for the report. It seems to be a problem with doing if #available
in the body of navigationDestinationWrapper
. That introduces an AnyView
, and somehow that causes the problem when deploying to iOS 16 and running on an iOS 17 device. No idea how!
But we do have a fix for it, so just update your navigationDestinationWrapper
as described here #2765.
@mbrandonw Thanks for the quick fix! This did indeed resolve the issue I was having!
Description
Currently following the 1.7 Migration Guide and having an issue with
navigationDestination(item:destination:)
.My app supports iOS 16, and so I'm using the
Perception
tools. This happens on iOS 17.My app's set up is that the root reducer uses a
switch / case
to switch between the onboarding and the tab view, there are a number of tabs, each with a navigation stack, etc.Within this hierarchy, the reducer within the tab presents a leaf state on a button press through
navigationDestinationWrapper(item:destination:)
(using the wrapper suggested in the migration)Tapping the button once navigates, then pressing back and navigating again does not navigate forward.
If you remove the
Switching
reducer or theTabbed
reducer/view from the hierarchy, it works as expectedChecklist
main
branch of this package.Expected behavior
Pushing and popping the view should always work.
In my example, tapping
First Child
, dismissing, thenFirst Child
again, the view will not navigate the second time.Actual behavior
The view is pushed on the first attempt, and won't get pushed again on subsequent attempts.
In my example, if you tap
First Child
, dismissing, thenSecond Child
, dismissing, thenFirst Child
again, everything works as expected,Steps to reproduce
A basic repro
The Composable Architecture version information
1.7.2
Destination operating system
iOS 17
Xcode version information
Xcode 15.2
Swift Compiler version information