I imagine the solution for the Day 46 Navigation challenge will be posted soon. I think that should answer my questions.
In the mean time, I'm posting here, too. I clearly don't fully understand the use of NavigationLink and .navigationDestination when using it with a ForEach on a data structure. I think I understand the examples in the lessons where Paul uses Ints and Strings. I'm missing something, though, in the translation.
I'm working on a side learning project using SwiftData that includes this simple Class:
In the current version of my app I can navigate seemingly just fine using the usual construct:
I've tried to re-do using the .navigationDestination method but can't get it to work. Latest broken attempt:
Can someone help me connect the dots between the seemingly more basic examples in the day's lesson and what it is I'm trying to do?
I realize this is similar to the challenge #1 to modify iExpense so that solution may help when it is posted.
thanks for any guidance -- jay
@jayelevy needs some help getting to a destination.
Thanks for posting code. This helps show where you may have not grasped the concepts.
@twoStraws has a nice video on this.
Using a standard
Using the updated
This gives you flexibility (see code snip) because now you can have ONE
An additional benefit is that SwiftUI now builds only ONE view, rather than (potentially) hundreds of views that may never be displayed.
thanks for the explanation. Very helpful
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.