I have this code and I want to pick a random element from Array1 and a random element from Array2 but Xcode is only giving me the number of the element.
let firstNrVar = [0, 2, 4, 6, 8, 10]
let secondNrVar = [0, 2, 4, 6, 8, 10]
func numberRandomizer() {
let shuffledFirstNr = Int(arc4random_uniform(UInt32(firstNrVar.count)))
firstNrLbl.text = "\(shuffledFirstNr)"
print(shuffledFirstNr)
let shuffledSecondNr = Int(arc4random_uniform(UInt32(secondNrVar.count)))
secondNrLbl.text = "\(shuffledSecondNr)"
print(shuffledSecondNr)
}
let firstValue = firstNrVar[shuffledFirstNr]Your label would then be set viafirstNrLbl.text = "\(firstValue)"Currently, you're only getting a random index, not the array's value at that index.