.navigationDestination wrapper for enum cases doesn't appear to do anything
#129
-
DescriptionI just started using this library for the first time after having watched the Modern SwiftUI series on pointfree.co and it looks like the Checklist
Expected behaviorI expected a parent view to navigate to a detail view within a navigation stack. Actual behaviorIt didn't do anything. Steps to reproduceI've thrown together a sample project illustrating this issue. Hopefully this captures the behavior you need. NavigationDestinationBusted.zip SwiftUI Navigation version information1.0.2 Destination operating systemiOS 17 Xcode version informationVersion 15.0 (15A240d) Swift Compiler version informationswift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx14.0 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
@gposcidonio Your sample project has the I'm going to convert this to a discussion since it's not a bug in the library. |
Beta Was this translation helpful? Give feedback.
@gposcidonio Your sample project has the
navigationDestinationview modifier applied outside theNavigationStackview, which prevents it from working (same goes for the vanilla modifier that comes with SwiftUI). MovingnavigationDestinationinto theNavigationStackfixes things, though we should note thatnavigationDestinationhas had a buggy history in vanilla SwiftUI, and so you may want to look out for those bugs and file feedback with Apple if you encounter them.I'm going to convert this to a discussion since it's not a bug in the library.