У меня проблема с этим UInt32
, у «ответа» в моей кнопке есть ошибка об этом «Невозможно добавить значение типа [[String]]
с индексом типа UInt32
»
let answers = [["1. After the exam, I felt too exhausted and famished to eat my foods.","2. I could eat a horse, I am a famish now.","3. I famished my stomach next time you treat me to a meal out.","4. I will bring lots of pizza, that's famish."],["Would","Has to","Must","Could"]]
var rightanswerplacement:UInt32 = 0
rightanswerplacement = arc4random_uniform(2)+1
var button:UIButton = UIButton()
var x = 1
for i in 1...3{
button = view.viewWithTag(i) as! UIButton
if (i == Int(rightanswerplacement)){
button.setTitle(answers[rightanswerplacement][0], for: UIControlState.normal)
}
else{
button.setTitle(answers[rightanswerplacement][x], for: UIControlState.normal)
x = 2
}
currentquestions += 1
}