|
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:
|
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until February 9th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
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.