I\'m trying to learn SwiftUI, and how bindings work.
I have this code that works, that shows a list of projects. When one project is tapped, a binding to that project is
Unfortunately this doesn't seem to be possible at this time. The only way to achieve this is like the following:
ForEach(state.projects.indices) { index in
NavigationLink(destination: ProjectView(project: state.projects[index])) {
Text(state.projects[index].title)
}
}
NOTE: I didn't compile this code. This is just to give you the gesture for how to go about it. i.e. use and index of type Index and not Int.