Not sure how to tackle this. I am making a vocabulary app and am very new to coding. I have made sure the NavigationLink and its contents are correctly set up as well. Getting the error message at the line:
NavigationLink(destination: VocabListView(pack: vocabPack)) {
import SwiftUI
struct LiteratureTextView: View {
let text: LiteratureText
var body: some View {
List {
ForEach(text.subPacks) { pack in
switch pack {
case .vocabulary(let vocabPack):
NavigationLink(destination: VocabListView(pack: vocabPack)) {
VocabularyPackView(pack: vocabPack)
}
case .quotes(let quotePack):
if quotePack.name == "First Letters" {
NavigationLink(destination: FirstLettersListView(pack: quotePack)) {
VocabularyPackView(pack: quotePack)
}
} else {
NavigationLink(destination: QuotesListView(pack: quotePack)) {
VocabularyPackView(pack: quotePack)
}
}
}
}
}
.navigationTitle(text.name)
}
}
Made sure that some identifiers are Identifiable
New contributor
Audvik Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2