https://developer.apple.com/wwdc22/10054 doesn't explain multi NavigationLink in one cell.
Post
Replies
Boosts
Views
Activity
class FinalBluePrint: ObservableObject {
@Published var currentGrade: Double = 5;
@Published var desiredGrade : Double = 0;
@Published var finalWeight : Double = 0;
var finalNeededGrade : Double {
let desiredGrade = self.desiredGrade;
let currentGrade = self.currentGrade;
let finalWeight = self.finalWeight;
let finalNeededGrade = (desiredGrade - currentGrade * (100 - finalWeight)) / finalWeight;
return finalNeededGrade
}
}
struct ContentView: View {
@StateObject var final = FinalBluePrint()
var body : some View {
NavigationView {
VStack {
TextField("Current Grade", value: $final.currentGrade, format: .number).keyboardType(.decimalPad);
TextField("Desired Grade", value: $final.desiredGrade, format: .number).keyboardType(.decimalPad);
TextField("Final Weight", value: $final.finalWeight, format: .number).keyboardType(.decimalPad);
Text(final.currentGrade, format: .number);
Text(final.finalNeededGrade, format: .number);
}
}
}
}
List in List does not work well.
You should change code like below code
List {
Button("ADD") {
}
Section {
ForEach(data) { datum in
}
}
}
I face to same issue in Playground. Normal Project can compile it.