Hi! I'm a beginner in making apps. I'm making a quiz app, but I have a problem. To avoid questions are shown twice in my quiz, I would set a list with the already shown questions.
Does anyone know how to do this?
Here's some code:
struct Question {
let text: String
let answers: [Answer]
}
struct Answer {
let text: String
let correct: Bool
}
private func ConfiqureUI(question: Question){
label.text = question.text
label.adjustsFontSizeToFitWidth = true
CurrentQuestion = question
table.reloadData()
}
let NextQuestion = allQuestions.randomElement()
print("\(NextQuestion!.text)")
CurrentQuestion = nil
ConfiqureUI(question:NextQuestion!)
Progress += 1
updateLabel()
Thanks in advance!