Post

Replies

Boosts

Views

Activity

Reply to Do not repeat question, removeAtIndex
Apologies, theres my code above, my questions are located in    private func setupQuestions() {     gameModels.append(Question(text: "How old am I, answers: [       Answer(text: "18", correct: false),       Answer(text: "21", correct: true),       Answer(text: "20", correct: false),       Answer(text: "None Of The Above", correct: false)     ]))     gameModels.append(Question(text: "Where am I from?", answers: [       Answer(text: "NZ", correct: true),       Answer(text: "Australia", correct: false),       Answer(text: "France", correct: false),       Answer(text: "US", correct: false)     ])) } And at the bottom: struct Question {   let text: String   let answers: [Answer] } struct Answer {   let text: String   let correct: Bool //true / false } Forgot to mention if it worthwhile knowing that my first block of code I showed you that goes onto the next question is:      let answer = question.answers[indexPath.row]     if checkAnswer(answer: answer, question: question) { Thanks for all the help so far by the way :)
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21