I want to get array value by it's key.
I set the array with below code inside looping .
let que = Question(questionText: "\(questionWord)", options: quizAnsArr, correctAns: correctArrIndex, wrongAns: -1, isAnswered: false)
quizsArray += [que]
Now I get the below array. Here is my array.
[Kanji_Quiz.Question(questionText: "青", options: ["fast", "color", "heart", "blue"], correctAns: 3, wrongAns: -1, isAnswered: false), Kanji_Quiz.Question(questionText: "暑", options: ["owner", "heart", "hot (temperature)", "end"], correctAns: 2, wrongAns: -1, isAnswered: false)]
I was calling the value by using
print(quizsArray[questionText])
But it' show error. How can i call the value by index or smth. Please help me.
questionTexts from your array to another array and then loop through that array to show question texts on yourbuttons.