I have collapse list in main view, i wanna to go in another view when i tap in a child of section in list, i tried but it didint work. Nothing didnt change when i tapped. What im doing wrong ?
func sectionIndex(section : Theme) -> Int {
userData.data.firstIndex(where: {$0.name == section.name})!
}
var body: some View {
NavigationView {
List {
ForEach(userData.data) { section in
Section(header: HeaderView(section: section)
.onTapGesture {
self.userData.data[self.sectionIndex(section: section)].expanded.toggle()
}, footer: EmptyView()) {
if section.expanded {
ForEach(section.questions!) { question in
QuoteView(question: question)
.onTapGesture {
NavigationLink(destination: DetailView()) {
Text("Do Something")
}
print("dsdsw")
}
}
}
}
}
}
}
}
}
struct DetailView : View {
var body: some View {
Text("Hello World B")
}
}