I have a function that displays "correct" when the user puts in the right answer.
func displayCorrectOrIncorrect() -> some View {
Group {
if correctAnswer == quiz.answer {
VStack {
Text("Correct")
}
} else {
VStack {
Text("Incorrect, correct answer is \(correctAnswer)")
}
}
}
}
This is how I call it:
Button(action: {
self.displayCorrectOrIncorrect()
self.updateUI()
})
The text is not showing up. How can I fix this?