|
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 Efficient CodeUsing 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.
Keep Coding! |
|
SPONSORED Transform your career with the iOS Lead Essentials. Unlock over 40 hours of expert training, mentorship, and community support to secure your place among the best devs. Click for early access to this limited offer and a FREE crash course.
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.