Hi !
I am having a very strange problem. I display a list of elements, and I created a view that takes this element as a parameter in order to allow the user to modify it in another view.
my var with a forEach :
@Binding var liste : Liste
my code :
ScrollView {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))], spacing: 5) {
ForEach(liste.cartes) { c in
NavigationLink(destination: ModifierUneCarte(carte: c)) {
VStack {
Text(c.devant)
.font(.system(size: 14))
Divider()
Text(c.derriere)
.font(.system(size: 14))
}
}
}
}
}
and my ModifierUneCarte :
struct ModifierUneCarte: View {
[...]
@Binding var carte: Carte
[...]
And I have this error on a lot of lines :
Conflicting arguments to generic parameter 'Content' ('<<hole>>' vs. '<<hole>>' vs. '<<hole>>' vs. '<<hole>>')
but it's because of :
NavigationLink(destination: EditMap(map: c)) {
because when I remove it everything works...
J'ai modifié comme suit:
ScrollView {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 100))], spacing: 5) {
ForEach($liste.cartes) { $c in
NavigationLink(destination: ModifierUneCarte(carte: $c)) {
Dans le simulator:
Note: le preview en revanche n'affiche pas la liste..