Tried to do a func but having issues returning "some view". I'm trying to do a while loop with a continue statement as well but that's not allowed within the body of the viewBuilder... what's the easiest way to use pickers when conditions change?
var body: some View {
VStack{
Group{
Form {
Section(header: Text("\(screeningTable())")) {
Picker(selection: $updateMaleBodyCompView.age, label: Text("Select age")) {
List(maleDataModel.ageArray, id: \.self) { i in
Text("\(i, specifier: "%g")-years-old")
}
}
if updateMaleBodyCompView.age == 0 || updateMaleBodyCompView.height == 0 || updateMaleBodyCompView.weight == 0 {
Section {
Text("Fill all required fields").foregroundColor(.red)
}
}
if screeningTable() == "No Go" {
Section(header: Text("Tape Mesurements")) {
MaleTapeView()
}
}
if updateMaleBodyCompView.age != 0 && updateMaleBodyCompView.height != 0 && updateMaleBodyCompView.weight != 0 && screeningTable() != "No Go"{
Section(header: Text("You are not required to tape").foregroundColor(.blue)) {
MaleSaveButton()
}
}
}
}