|
Hi! I'm working on the Navigation challenge (day 46) and upgrading my Moonshot app to use NavigationLink(value:). I successfully changed it in multiple places but I'm stuck on the one in the ContentView. Here's the code I have for the ContentView:
When I comment the MissionView inside the .navigationDestination and use the TextView instead (for the testing purposes), it works just fine. But when I try to use MissionView as a destination, I get the following message in the console:
Here's the MissionView code:
Any suggestions on how to fix the issue are appreciated ❤️ |
|
+1 this question. I think we talked about this on Slack Paul :) I'll keep digging and let you know if I find anything |
|
I've found programmatic navigation works quite differently from what we're used to, my finding was that when I remove NavigationStack from the MissionView it is then able to pick up on that navigationDestination and finally see it. In short just try to remove the NavigationStack from your MissionView, and note that you can still use navigationTitle modifier in it. Here's my ContentView and MissionView in case I've missed something, let me know if it works:
|
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.